Solved

cp -arL /etc /tmp/etc.backup

Posted on 2011-02-26
2
475 Views
Last Modified: 2012-08-14
what will this command do ?
0
Comment
Question by:aashee
  • 2
2 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 34988495
Hi,

this command will copy ("cp") recursively ("-R", which is already implied with "-a") the contents of the /etc directory to the /tmp/etc.backup directory.
It will work in archive mode ("-a") which means "recursively" (include subdirectories and files in subdirectories), "do not follow links" (copy the links themselves, not their targets) and preserve all attributes like mode,ownership,timestamps ...

wmp
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 34988703
Seems I overlooked the option "-L" in your post.

No wonder, because it's contradictory to "-a",

"-a" implies " --no-dereference" , which means "don't follow symbolic links", whereas "-L" is the same as "--dereference", which means "always follow symbolic links" (= create real files instead of links).

As the last entered option takes precedence the command you posted will copy files instead of their links. You will have to decide whether this is the desired behavior.

wmp


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Anti-Spam SMTP Proxy Server (@SSP) 7 85
Block sender e-mail address in Postfix 4 66
AWS- KeepAlived notify script not working 23 49
Video Streaming 6 56
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now