0

I have set of image files in a directory that I want to delete using command-line. The file names progress as follows:

image0000.png
....
image0599.png

I know we will need to use for-loop in the commmand-line but what would be the right syntax?

1 Answer 1

0

If you want to delete all the files in a directory with names like imageXXX.png, you won't have to use a for loop. You can use a wildcard like this rm image*.

Note-This will remove all the files in the current directory with names like imageXXXX

1
  • it worked! so assuming I would want to remove say only from image001 to image019, will I need for-loop then? Aug 16, 2020 at 14:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .