Remove all files but one with rm
In unix, to remove zip files in a directory one can simply type
How can one remove everything except zip files?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
This appears to work. The ! represents "not".
extglob needs to be enabled in the shell behavior settings for this to work. It is probably already enabled... but if not, enable it with:
shopt -s extglob
And after answering this... indeed Ignacio Vazquez-Abrams you are correct. It is pretty much duplicate.