How to copy directory in Linux

To copy a directory in Linux, the following command must be used:

cp -rfpa dir1 dir2

All four of the parameters (-rfpa) as shown here MUST be used to produce dir2 which is an exact duplicate of dir1.

Most other websites specify just the two options -rf. This is not sufficient for an exact copy.



˅˅˅ Additional valuable information is available at one of the links below: ˅˅˅

 

Did you like the article? Let Google Search know by clicking this button: . Please link to content that you find useful on this website on your own website, forum or blog! You can also comment on this page below, or to ask a question or suggest a topic for me to research. There is a user-editable Wiki available on my website, as well as a Forum that you can contribute to. Site Map.

Page last modified 21-May-16 14:33:45 EDT
Comments on this page:


Add a comment to this page
Comment Title:
Your Name:
Your Email Address:
Notify me of new comments to this item:
Additional Comments:
This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)