Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to remove all the .jpg files from my Music folder in order to save room. My Music folder contains subfolders, and I would like to know if there is a command to remove all the .jpg files from all these folders regardless of their level. Thanks for your help!

share|improve this question
up vote 6 down vote accepted

The easiest way (if you are using Ubuntu Desktop):

Go to your Music folder in Nautilus, press Ctrl+F and search for .jpg.

enter image description here & then delete it

You can also change the location and you can make your search more specific.

enter image description here


Be More specific after searching .jpg Clicking on green button Select File type Picture & then remove jpg from search only . dot & then reload as shown in pic below

What it does it will search Picture file like .jpg .png .gif & all other file which are in Picture Format

enter image description here

share|improve this answer
even better :) :) – Rinzwind Feb 16 '12 at 18:34

A quick and clean solution for the command line would be

cd <dir>
find . -type f -iname \*.jpg -delete
  • . tells to start searching in the current folder.
  • -type f tells find only to look for files.
  • -iname makes the search case insensitive.
  • -delete tells find to delete/remove all files found.

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.

For more information on how to use find and what it can do see man find

Note that find will not produce any output when -delete is used.

share|improve this answer

This should do it

sudo rm -rf -d ~/Music/*.JPG

which will remove all .JPG files within the Music folder.

share|improve this answer
This will not remove files from subfolders … – knittl Feb 16 '12 at 19:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.