I have a directory of test files labelled 1
, 2
, 3
, 4
, 5
, 6
, 7
, 8
, 9
, 10
, 11
, 12
along with others labelled ex1
, ex2
, ex3
, etc...
I tried to remove all files from this directory whose name doesn't include 'ex' using the following code:
rm [^a-z]
It was successful in removing all files labelled with a single digit, however files 10-12 still remain and I can't understand why.
Can someone please explain why this is happening?
Currently left in this directory are all files beginning with 'ex', and files labelled 10
, 11
, 12
. Upon using the command once again the following error message appears:
rm: [^a-z]: No such file or directory