Hm... say I wanted to remove all mp3 files from a certain directory, I'd use "rm -f *.mp3"... what would I do if I wanted to remove everything /but/ mp3 files?
Sure, I /could/ move the mp3 files to somewhere else and delete the original folder I guess, but meh.
#linux
@Morgan @maunzikation rm $(ls | grep -v '\.mp3$')
Test it first by replacing rm with echo…
Explanations : -v means "everything BUT". $(command) means "executes this command and replace the $(stuff) by the result of the command"