I have many files named
sequence_1_0001.jpg
sequence_1_0002.jpg
sequence_1_0003.jpg
...
and files named
sequence_1_0001.hmf
sequence_1_0002.hmf
sequence_1_0003.hmf
...
and files named
sequence_2_0001.jpg
sequence_2_0002.jpg
sequence_2_0003.jpg
...
and
sequence_2_0001.hmf
sequence_2_0002.hmf
sequence_2_0003.hmf
...
I just want to remove the files that begin with 'sequence_1' and end in '.hmf', but I don't want to remove them one by one, since there are thousands of files. How can I specify to the rm command that I want to remove all that begin with the prefilx 'sequence_1' and end in '.hmf'?
I'm currently working with a RedHat Linux system, but I'd like to know how to do it on other distributions as well.
find
approach becomes easier than guess and check. – jw013 Apr 26 '12 at 14:24for
solution. Somehow I could not get to figure out how to usefind -regex
to match my files and your solution works just fine! – Adrien Nov 02 '21 at 14:13