LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Moving all mp3s to a single directory (https://www.linuxquestions.org/questions/linux-newbie-8/moving-all-mp3s-to-a-single-directory-342548/)

wjleon 07-12-2005 02:54 PM

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

Tinkster 07-12-2005 03:15 PM

Almost there :)

find / -iname "*.mp3" -exec mv "{}" /path/to/target/. \;

darkleaf 07-12-2005 03:18 PM

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.

v00d00101 07-13-2005 01:58 AM

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.

Tinkster 07-13-2005 03:26 AM

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


All times are GMT -5. The time now is 04:59 AM.