Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Iiwii

macrumors newbie
Original poster
Mar 7, 2008
22
0
I'm trying to copy mp3s from different subdirectories which is located in my Music directory but when i try cp *.mp3 ~/Desktop/Songs , i get an error saying no *.mp3 files were found
I have tried cp -R *.mp3 ~/Desktop/Songs and also cp -a *.mp3 ~/Desktop/Songs

when I am typing the command I am already in my "Music" directory, the songs are located in sub sub directories within that Music folder. I was able to do this by Google searching before but now I cant find it and I'm getting frustrated :-(
any help/advise is great :)
 

GGJstudios

macrumors Westmere
May 16, 2008
44,545
943
Why are you trying to do this in Terminal, when Finder can do this quite simply?
 

blevins321

macrumors 68030
Dec 24, 2010
2,768
96
Detroit, MI
Two issues with your statement -

1-You need to do a recursive search, so that it will actually enter the subdirectories. So like cp - r /source /dest

2 - Do you think you'll have issues with files in the various directories having the same file name? You'll need to decide how to handle those. If you do a -i in the command too, it'll ask you if you want to overwrite or not.
 

Iiwii

macrumors newbie
Original poster
Mar 7, 2008
22
0
I moves the Music folder to the Desktop as well as the Songs folder to make it easier for me,
inside the Music folders I have a lot of directories and subdirectories (in itunes it moves all my songs it to it's own folder.) Artist is one folders and inside that folder is the Album then song.
I tried cp -r ~/Desktop/Music/*.mp3 ~/Desktop/Songs
I did that with -r -R and also -a (not at the same time) and all said no such file or directory

If I try to do this in Finder I only know how to drag and drop which will work, but then I would have to do it to all the sub directories which would take me a very long time, unless there is a another method.

Also there shouldn't be any issues with double file names.
 

GGJstudios

macrumors Westmere
May 16, 2008
44,545
943
I moves the Music folder to the Desktop as well as the Songs folder to make it easier for me,
inside the Music folders I have a lot of directories and subdirectories (in itunes it moves all my songs it to it's own folder.) Artist is one folders and inside that folder is the Album then song.
I tried cp -r ~/Desktop/Music/*.mp3 ~/Desktop/Songs
I did that with -r -R and also -a (not at the same time) and all said no such file or directory

If I try to do this in Finder I only know how to drag and drop which will work, but then I would have to do it to all the sub directories which would take me a very long time, unless there is a another method.

Also there shouldn't be any issues with double file names.
I'm not sure I understand what you're trying to do. Are you wanting to copy your entire music folder, that contains subfolders, keeping the folder structure intact? If so, just copy the top folder and paste wherever you want it. That will copy all the contents of the folder, as well.

If you only want to copy the songs, without the folder structure, you can use Finder to search the music folder for all music files, then Command-A to select all, Command-C to copy, then paste them wherever you want them.

It would help if you explain what it is you're trying to accomplish by copying the files, in the first place.
 

Iiwii

macrumors newbie
Original poster
Mar 7, 2008
22
0
I'm not sure I understand what you're trying to do. Are you wanting to copy your entire music folder, that contains subfolders, keeping the folder structure intact? If so, just copy the top folder and paste wherever you want it. That will copy all the contents of the folder, as well.

If you only want to copy the songs, without the folder structure, you can use Finder to search the music folder for all music files, then Command-A to select all, Command-C to copy, then paste them wherever you want them.

It would help if you explain what it is you're trying to accomplish by copying the files, in the first place.

hehe your right I didnt explain my self properly, I wanted to take the mp3s from all the subdirectory and put them into one directory
 

GGJstudios

macrumors Westmere
May 16, 2008
44,545
943
hehe your right I didnt explain my self properly, I wanted to take the mp3s from all the subdirectory and put them into one directory
So they'll all be in one folder, with no subfolders? If so, use the method in my last post.
 

Iiwii

macrumors newbie
Original poster
Mar 7, 2008
22
0
yeah I was able to do it :) thanks!
I can enjoy the rest of my day now :p
Ps: in terminal you can also do
cp -a /*/*/*.mp3 ~/Desktop/Songs
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.