I have came across globbing patterns and wildcards and of particular interest to me is [!]
This construct is similar to the
[!]
construct, except rather than matching any characters inside the brackets, it’ll match any character, as long as it is not listed between the[
and]
rm myfile [!192]
The above I believe will remove any/all files, except for any/all files which have 192 in their name.
I am concerned however but the proper usage of this with a file extension, and in particular multiple conditions.
What would be the proper syntax in such a situation?
rm myfile [!.gif .csv. mp3]
or
rm myfile [!.gif !.csv !.mp3]
My worry is that the period might be misplaced, and so ANY file with a .
(which would be any of them surely?) would then be manipulated, when I am seeking to cause manipulation of specific files.
This construct is similar to the [ ] construct, except rather than matching any characters inside the brackets, it’ll match any character, as long as it is not listed between the [ and ].
(quoted from http://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm)
Now; to me that suggests then a singular ! is sufficent, and all values therein after are contained within the range. But as they say, devil is in the details