Wednesday, April 11, 2012

bash extended globs :: rm all *.jpg files except two particular ones

Can I use Bash extended glob patterns to implement logical 'AND' ? Say I have a folder of jpg files and I want to rm all except A.jpg and B.jpg. How would I do that without trying tricks like remaming the files temporarily and so on ? I guess the general theme is how one can combine logical expressions and negations in Bash extended globs.





No comments:

Post a Comment