Solved

cp -arL /etc /tmp/etc.backup

Posted on 2011-02-26
2
477 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

776 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