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 have a directory that contains around 100 subdirectories. I want to take all the files from this directories and add them to the first directories then delete them all. Is this possible?

share|improve this question
up vote 3 down vote accepted

You can paste a command like this at terminal:

find /source/dir/* -exec mv {} /destination/dir/ \;
share|improve this answer

Call me old-fashioned, but I'm usually using Midnight Commander for this :) You can install it using

sudo apt-get install mc

then start it by typing


then hit Esc, Ctrl-?, enter your search criteria, click [ Panelize ] button - voila, you can do anything you want with your files - copy, move, delete... the nice thing about using mc is that you can review the list of files and manually select only some of them... i.e. sort the result by size and delete only the 10 largest files, for example, or select files by size so they fit on a CD as close as possible, etc.

share|improve this answer

Execute the following in the root directory: find -exec mv {}/* . \;

This puts all files from all subdirectories in the directory in which you execute it.

share|improve this answer

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.