First, browse to the folder in which you want to delete files with a specific extension
Then delete the files with the extension .jpg
find . -type f -iname \*.jpg -delete
.tells to start searching in the current folder.
-type ftells find only to look for files.
-inamemakes the search case insensitive.
-deletetells find to delete/remove all files found.
Change .jpg with the file extension you want to delete from a folder. I recommend running the command without
-delete first to get a list of the files that will be removed when
-delete is included in the command. This way a small typo won’t delete anything you didn’t intend to.