We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
First, expand rm capabilities by: shopt -s extglob
shopt -s extglob
Then use find and remove: find . ! -name 'file.txt' -type f -exec rm -f {} +
find . ! -name 'file.txt' -type f -exec rm -f {} +