I have a mp3 Player. I have connected it to my PC which has Ubuntu as an OS.
I want to delete all the files that are not .mp3.
I know that for deleting them the command is rm *.mp3, but what’s the combination for negating this?
I’ve tried: rm ^.mp3, ^mp3 ^[mp3], but they didn’t work! Any suggestion?
Assuming you are using
bashandextglobis set, you should be able to:I would try a test with
lsbefore blindly running that command:To check the value of
extglob:And to turn it on, if necessary: