|
m00nshine
ÜBER SHAMAN




Registered: 11/18/05
Posts: 9,774
Loc: BALLS DEEP
|
Hope someone can help me with this - file transfer question
#14050634 - 03/01/11 07:31 PM (13 years, 4 days ago) |
|
|
I'm trying to move audio files that are in folder like this:
\artistname\randomfolder\song.mp3
and I want to move everything to a folder on the desktop,
desktop\a
This is on a current mac
I know linux so I can use the terminal well
Does anybody know of a good script or of how to write one?
Thanks for any help.
--------------------
|
frith
God

Registered: 10/27/09
Posts: 7,512
Loc: Philadelphia, PA
|
Re: Hope someone can help me with this - file transfer question [Re: m00nshine]
#14051191 - 03/01/11 09:09 PM (13 years, 4 days ago) |
|
|
you want all the .mp3 files in one directory? you dont want to organize them at all?
if everything is in that folder structure, you could just copy everything like this:
Code:
cd /path/to/music/ cp */*/*.mp3 /home/username/Desktop/music/
or if you just want to move all the directories from one location to the other you could do:
Code:
cd /path/to/music/ cp -r * /home/username/Desktop/music/
you need the -r option to copy directories. without it, cp will copy the files directly specified and ignore all the subdirectories and their included files.
i know the OSX filesystem hierarchy is a little different than linux so the desktop path may be a little different.
--------------------
|
m00nshine
ÜBER SHAMAN




Registered: 11/18/05
Posts: 9,774
Loc: BALLS DEEP
|
Re: Hope someone can help me with this - file transfer question [Re: frith]
#14051257 - 03/01/11 09:21 PM (13 years, 4 days ago) |
|
|
Great, thanks once again.
I didn't know you could use the wildcard for directories, too.
--------------------
|
frith
God

Registered: 10/27/09
Posts: 7,512
Loc: Philadelphia, PA
|
Re: Hope someone can help me with this - file transfer question [Re: m00nshine]
#14051308 - 03/01/11 09:32 PM (13 years, 4 days ago) |
|
|
yep. you can use them for anything.
i guess heres another tip that i just thought of.. when i show people some basic terminal navigation most dont think about the .. directory thing.
.. lets you move up one level in the filesystem hierarchy.
for example: if you wanted to copy ~/Music/rap/something.mp3 to ~/Music/country/ you could do this instead of writing out the whole file path:
Code:
cd ~/Music/rap/ cp something.mp3 ../country/
yay term tips!
--------------------
|
Seuss
Error: divide byzero



Registered: 04/27/01
Posts: 23,480
Loc: Caribbean
Last seen: 23 days, 17 hours
|
Re: Hope someone can help me with this - file transfer question [Re: frith]
#14052867 - 03/02/11 04:46 AM (13 years, 3 days ago) |
|
|
I would have used cpio or rsync rather than cp to preserve timestamps.
-------------------- Just another spore in the wind.
|
frith
God

Registered: 10/27/09
Posts: 7,512
Loc: Philadelphia, PA
|
Re: Hope someone can help me with this - file transfer question [Re: Seuss]
#14055400 - 03/02/11 03:49 PM (13 years, 3 days ago) |
|
|
true.. i dont generally care about sorting by date
--------------------
|
|