Solved

cp -arL /etc /tmp/etc.backup

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Remote desktop Ubuntu from Windows 10 5 97
awk file 6 79
bash file 10 50
Samba Question 11 80
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

821 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