cp command in terminal

Ok, i’m guessing my syntax is off but can you help me spot why? Below is what i got when i tried to copy a directory off of a network drive. I have read access to the drive and can copy the folder with finder and the error lists the correct number of files and their correct names but what’s with the “no such file or directory” message? am i missing a trialing / or did i include an extra? i’m trying to copy the folder to my dekstop.

001mac:~ bbenjamin$ cp -r /Volumes/crimescene$/“2009 Crime Photos”/09-0001025-2007 ~/Users/Desktop
cp: /Volumes/crimescene$/2009 Crime Photos/09-0001025-2007: No such file or directory
cch02da001mac:~ bbenjamin$ cp -r /Volumes/crimescene$/“2009 Crime Photos”/09-001025-2007 ~/Users/bbenjamin/Desktop/
cp: /Users/bbenjamin/Users/bbenjamin/Desktop: No such file or directory
cp: /Volumes/crimescene$/2009 Crime Photos/09-001025-2007: unable to copy extended attributes to /Users/bbenjamin/Users/bbenjamin/Desktop: No such file or directory
cp: /Users/bbenjamin/Users/bbenjamin/Desktop/09-001025-2007.log: No such file or directory
cp: /Users/bbenjamin/Users/bbenjamin/Desktop/09-001025-2007_0000.JPG: No such file or directory
cp: /Users/bbenjamin/Users/bbenjamin/Desktop/09-001025-2007_0001.JPG: No such file or directory
cp: /Users/bbenjamin/Users/bbenjamin/Desktop/09-001025-2007_0002.JPG: No such file or directory
cp: /Users/bbenjamin/Users/bbenjamin/Desktop/09-001025-2007_0003.JPG: No such file or directory
cp: /Users/bbenjamin/Users/bbenjamin/Desktop/Thumbs.db: No such file or directory

one thing I noticed is that you are using.
~/Users/Desktop
or…
~/Users/bbenjamin/Desktop/
the tidy (~) denotes your HOME folder, so all you need is this.
~/Desktop

Tom

Hi,

you have to quote the full path

'/Volumes/crimescene$/2009 Crime Photos/09-0001025-2007'

or escape each space character

/Volumes/crimescene$/2009\ Crime\ Photos/09-0001025-2007

thanks. i’ll give it a shot.

here are 2 Terminal commands that should work.

cp -r ‘/Volumes/crimescene$/2009 Crime Photos/09-0001025-2007’ ~/Desktop

cp -r /Volumes/crimescene$/2009\ Crime\ Photos/09-0001025-2007 ~/Desktop

and 2 shell scripts…

do shell script "cp -r '/Volumes/crimescene$/2009 Crime Photos/09-0001025-2007' ~/Desktop"
do shell script "cp -r /Volumes/crimescene$/2009\\ Crime\\ Photos/09-0001025-2007 ~/Desktop"

Tom

thanks, worked like a charm. What does it mean in terminal when you get the “>” symbol after you’ve hit enter with you command. I got that when i messed up and included a trailing “/” on the source directory. Nothing would happen and terminal just sat there for a long time.

is an UNIX text editor prompt. You can exit it by pressing ctrl-c.
It can occur e.g. by forgetting the balancing single or quote quote