|
|
Copying a directory via Terminal
|
|
|
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
Can anybody tell me the command to copy a directory (and its subdirectories) to another volume? I have a HD that is dying and I can't get it to copy using the Finder, but Terminal is working when I do individual files. I am doing this:
Code:
cp /Volumes/stoker\ HD\ 1/Users/STOKER2245/ /Users/ThisGuy/Desktop/StokerBackup
and it is not working for me. If I navigate to the Documents folder I am able to copy individual files though. I know I'm doing something wrong.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Nov 2004
Location: Stockholm, Sweden
Status:
Offline
|
|
i'm not sat at a Mac right now, so i can't test this, but i think you need cp -R in there. run man cp for more info.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
Thanks for the quick reply. I'll try it out.
I did have some success using this:
Code:
mv /Volumes/stoker\ HD\ 1/Users/STOKER2245/ /Users/ThisGuy/Desktop/StokerBackup
I'll see what I end up with.
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Jun 2001
Location: planning a comeback !
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
Tried it with no luck.
Both mv and cp -R seemed to work though.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status:
Offline
|
|
Listen! A word of warning. If you have files in those directories that depend on resource forks, you will lose them with cp and mv. While these are rare on OSX these days, they do exist. Examples are textclippings and links, both of which store their contents in resource forks.
So, for instance, if you do a "cp somelink.webloc newlink.webloc" the copied link will be broken. And if you do that with mv, the link will be irretrievably lost.
If you have the developer tools installed, inside the tools folder, there are two utilities, CpMac and MvMac, that behave the same way as cp and mv, but also copy and move the resource forks.
The ditto utility can also copy directories with preserved resource forks. The format is:
"ditto --rsrc source_dir destination_dir"
|
weird wabbit
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Oct 2001
Status:
Offline
|
|
thanks for the info, theolein.
after messing around for a little bit i was wondering why it takes longer for a cp -R command to copy a file than it does for the Finder? i created a 40MB .dmg and on my PowerBook it took about 5 seconds to copy the file using the Finder. i did cp -R and the same copying took about 25 seconds.
|
|
|
|
|
|
|
|
|
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status:
Offline
|
|
Probably a damaged disk. Be thankful that you can at least still use the Terminal.
|
weird wabbit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|