4
votes
2answers
1k views

Removing files matching a numeric range regular expression

I have a folder which has many files. Some of the data files are labelled 1, 2, 3, ..., 300 I want to remove these data files using the terminal. How do I do this? I want to do something like rm ...
3
votes
3answers
5k views

Delete files with regular expression

I Tried to delete files that starts with A and ends with 2 numbers but It doesn't do a thing. What I tried: rm ^A*[0..9]2$ Where am I wrong?
0
votes
2answers
75 views

Remove files which have a certain syntax

I have a couple of files which follow this syntax: *_yyyy-mm-dd_hhhmmm.* Example: *_2010-01-01_00h10m.* *_2010-01-01_01h10m.* *_2010-01-01_02h10m.* *_2010-01-01_03h10m.* ... ...
2
votes
3answers
406 views

How to use “rm” to remove files with a “:” in them?

I am using Ubuntu 10.04, and I have a directory with a bunch of files. We changed the naming scheme of the files a while ago, and now I want to delete all the old ones. New Name scheme: ...