find . -maxdepth 1 -type f -iname \*.jpg -delete

 

 

find : finds all the files in the Path directory, you can use . for the current directory.

PATH: is the directories location

-maxdepth 1: Indicates we only want the currenty directory and no sub directory

-type f: tells the machine to look for files

-iname \*.jpg: Looks for all the files that end with .jpg

-delete: Deletes the selected files

 

Note: It is recommened to run this without -delete first to see if the files you wish to delete are the correct files.