X
X
The Best Tech Newsletter Anywhere

Join 250,000 subscribers and get a daily digest of news, geek trivia, and our feature articles.

Move Files Into One Directory in Linux With Find

If you want to move all files of a particular file type into a single directory, you can use the find command to do this easily in Linux.

Usage

Run this command from the root directory of where you want to find the files. For instance, if you wanted to find all .zip files from any subdirectory under /home and move them into the /backup directory, you would use the following command:

find /home -iname '*.zip' -exec mv '{}' /backup/ \;

This would move all the files into the same directory, so any files that were duplicated would be overwritten. Note that the subdirectories would not be copied, just the files.

Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio »

The above article may contain affiliate links, which help support How-To Geek.
How-To Geek is where you turn when you want experts to explain technology. Since we launched in 2006, our articles have been read more than 1 billion times. Want to know more?

x

The Best Tech Newsletter Anywhere

Join 250,000 subscribers and get a daily digest of news, comics, trivia, reviews, and more.