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?


You can paste a command like this at terminal:

find /source/dir/* -exec mv {} /destination/dir/ \;

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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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