LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 02: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, 03:15 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Almost there :)

find / -iname "*.mp3" -exec mv "{}" /path/to/target/. \;
 
Old 07-12-2005, 03: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, 01:58 AM   #4
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Devuan Beowulf
Posts: 514
Blog Entries: 1

Rep: Reputation: 37
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, 03:26 AM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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



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 07:04 AM
Moving my /home directory to another hd bumpert Linux - Newbie 6 07-26-2004 03:27 AM
problem moving directory sanjith11 Linux - Software 4 06-02-2004 07:06 AM
extract single directory from .tgz rickenbacherus Linux - General 2 02-07-2004 10:37 AM
Moving A Directory. reesee Linux - Newbie 6 02-04-2004 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:00 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
Open Source Consulting | Domain Registration