The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 mv files in dirs to one dir
Author: Dan 
Date:   03-03-10 17:33

Say you have a bunch of MP3 files, all in different folders, under a common directory. This moves them all to the same directory. That is, instead of a tree structure with folders, you now have all the files in one folder.

find /Users/Tree/Of/ALLMP3 -print0 -type f -exec mv {} /Users/Desktop/JustFiles \;

This will work with file names containing spaces.

Thank you.

--
Webmaster

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 mv files in dirs to one dir   new
Dan 03-03-10 17:33 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org