I am doing some practice question off a text book and I ran into one thing that I cannot seem to solve. It wants us to remove all files that
- start with a number and
- end is not a letter
So I use Linux and created a few empty files like this:
>1afsd.
>12fdfd
>12dfad
>23fdfa1
>fdafad!
I tried with this command
rm -i [0-9]
which only removes the ones that have number in it
rm -i *[!a-zA-Z]
which only remove the one that does not have a letter at the end.
Is there a way for it to do both? I tried
rm -i [0-9]* *[!a-zA-Z]
but it's just the same command ran twice. How do I combine them?
Note: I am using the -i so I don't delete the file or I have to recreate them every time.
rm [0-9]*[!a-zA-Z]? – sinelaw Sep 25 '11 at 7:09