Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Leopard's cp doesn't have the -a option

Leopard's cp doesn't have the -a option
Thread Tools
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Nov 29, 2007, 10:49 AM
 
I just noticed Leopard's cp command doesn't have the -a option that Redhat and Scientific Linux have.

Basically cp -a on these boxes is equal to cp -dpR. The Leopard cp has -pR but no -d. cp -d tells cp to not follow symlinks which is a pretty important option IMHO. Is there any way to get that option for Leopard's cp or is there a workaround?
     
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Nov 29, 2007, 02:29 PM
 
man cp?

And once you find the right flag, just setup an alias for your shell that points cp -a to whatever you need.
     
Posting Junkie
Join Date: Dec 2000
Status: Offline
Reply With Quote
Nov 29, 2007, 02:32 PM
 
I'm pretty sure it defaults to not following symlinks, unless you explicitly specify the -L flag. At any rate, the man page says -P should do what you want, so there you go.

Ticking sound coming from a .pkg package? Don't let the .bom go off! Inspect it first with Pacifist. Macworld - five mice!
     
Mac Elite
Join Date: Jul 2002
Status: Offline
Reply With Quote
Nov 29, 2007, 02:33 PM
 
Man page says symlinks aren't followed by default, so you don't need -d.
     
Simon  (op)
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status: Offline
Reply With Quote
Nov 30, 2007, 02:37 AM
 
Nice. cp -P seems to do the trick on Leopard. Thanks.

Is there anything similar for scp? The scp man page doesn't mention anything. Any ideas?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:34 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2