Usually on bash i did
shopt -s extglob
rm !(filedontwantremove)
and remove all files except filedontwantremove
But if i want to remove all file except filedontwantremove and "antotherfilewithatotaldifferentname"?
There is a find solution,but i prefer i thing like rm !()
info bash
says: "In the following description, a PATTERN-LIST is a list of one or more patterns separated by a '|' ..." – don_crissti Feb 21 '16 at 01:59GLOBIGNORE
: http://unix.stackexchange.com/a/1174/70524 – muru Feb 21 '16 at 02:15