LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-12-2005, 03:54 PM   #1
wjleon
Member
 
Registered: Apr 2005
Posts: 36

Rep: Reputation: 15
Moving all mp3s to a single directory


Hi, I got a simple question this time: I want to move all my mp3s to a single directory. I now that to find them a can use find like this

<code>
fina / -name "*mp3"
</code>

I think I need to use a pipe to connnect the find with the mv command but I don't really know how.

Thanks in advance,
Wilmer
 
Old 07-12-2005, 04:15 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Almost there :)

find / -iname "*.mp3" -exec mv "{}" /path/to/target/. \;
 
Old 07-12-2005, 04:18 PM   #3
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
You might want to check if there are no sounds from programs being moved I don't know which extension they have but you never know.
 
Old 07-13-2005, 02:58 AM   #4
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Fedora 8, Centos 5.1
Posts: 480

Rep: Reputation: 30
You may want to add a grep /home to that somewhere, so that it restricts moving, to files only found in /home. /home can be substituted for other places as well.
 
Old 07-13-2005, 04:26 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally posted by v00d00101
You may want to add a grep /home to that somewhere, so that it restricts moving, to files only found in /home. /home can be substituted for other places as well.
If he wanted to achieve that he'd have done a
find /home
instead of a
find /


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can updatedb update a single directory? neo_in_matrix Linux - Newbie 14 02-25-2005 08:04 AM
Moving my /home directory to another hd bumpert Linux - Newbie 6 07-26-2004 04:27 AM
problem moving directory sanjith11 Linux - Software 4 06-02-2004 08:06 AM
extract single directory from .tgz rickenbacherus Linux - General 2 02-07-2004 11:37 AM
Moving A Directory. reesee Linux - Newbie 6 02-04-2004 03:16 AM


All times are GMT -5. The time now is 10:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration