Showing posts with label find and move files to another folder. Show all posts
Showing posts with label find and move files to another folder. Show all posts

Thursday, November 27, 2008

Find all files matching a specific pattern and move them to a specified sub-folder


To find all files matching a specific pattern and move them to a specified sub-folder, this command will be handy:

# find . -type f -exec grep -q 'search_string' {} \; -exec mv {} sub_folder_location/ \;
 

A Linux Admin's WeBlog! Blak Magik is Designed by productive dreams for smashing magazine Bloggerized by Ipiet The Blog Full of Games © 2008