Solved

cp -arL /etc /tmp/etc.backup

Posted on 2011-02-26
2
483 Views
Last Modified: 2012-08-14
what will this command do ?
0
Comment
Question by:aashee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web resource - Man pages for SUSE Enterprise Linux 11 1 84
Samba Question 11 133
SSL/TLS - openssl troubleshooting 3 77
Edit smb.conf-file in Samba om a ReadyNAS 3 67
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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