What I am trying to do is extract all mine mp3 files that are in subfolders into one main folder. Can anyone help me i cannot remember how to do this in terminal
What I am trying to do is extract all mine mp3 files that are in subfolders into one main folder. Can anyone help me i cannot remember how to do this in terminal
Last edited by JustinJS; January 20th, 2009 at 08:44 PM.
Say that you want to copy the mp3 files in 'subfolder1' and 'subfolder2' to 'destinationfolder'. Then type
If you want to see what cp does, use the -v flag, likeCode:cp subfolder1/*.mp3 subfolder2/*.mp3 destinationfolder
Code:cp -v subfolder1/*.mp3 subfolder2/*.mp3 destinationfolder
...
Last edited by RequinB4; January 20th, 2009 at 09:28 PM.
'cp' is the command you want to use to copy in the CLI. If you are ever uncertain on how to use a specific command you can read the manual by typing 'man' then the command name. For example
will give you information on using the cp command. Very useful when you can't remember things like 'whats the option to copy folder recursively?' and other things like that.Code:man cp
Do not be afraid to joust a giant just because some people insist on believing in windmills.
Free Moonbase Commander remake @ http://code.google.com/p/tether
Yes.
find /path/to/mp3 -name "*.mp3" = find all *.mp3 in /path/to/mp3 and sub-folders
-exec cp {} /path/to/destination/dir \; = copy the files to /path/to/destination/dir
e.g.
Code:find ~/music -name "*.mp3" -exec cp {} ~/allmp3 \;-->Code:~/music/0.mp3 ~/music/band1/1.mp3 ~/music/band1/2.mp3 ~/music/band2/album1/3.mp3 ~/music/band2/album1/4.mp3 ~/music/band2/album2/5.mp3 ~/music/band2/album2/6.mp3
Code:~/allmp3/0.mp3 ~/allmp3/1.mp3 ~/allmp3/2.mp3 ~/allmp3/3.mp3 ~/allmp3/4.mp3 ~/allmp3/5.mp3 ~/allmp3/6.mp3
Bookmarks