From d14b2a8c2cff953b80b6a9c3ce0fc36db611f6d1 Mon Sep 17 00:00:00 2001 From: Mathias Rav Date: Fri, 11 Nov 2016 07:34:34 +0100 Subject: [PATCH] Use `-a` when copying a directory to copy mtimes When copying an entire directory, it's useful to maintain the individual modification times of the files and directories within. The argument `-a` maintains modification times, permissions, and enables recursive copying, whereas `-R` only copies recursively. --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index aeeb5dc..576a78b 100644 --- a/readme.md +++ b/readme.md @@ -58,7 +58,7 @@ cp readme.txt readme.bak.txt Copy `myMusic` folder under `myMedia` folder ``` -cp -R myMusic myMedia +cp -a myMusic myMedia ``` ## duplicate a folder @@ -68,7 +68,7 @@ cp -R myMusic myMedia If `myMedia` folder doesn't exist ``` -cp -R myMusic myMedia +cp -a myMusic myMedia ``` ## move a file