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.
This commit is contained in:
Mathias Rav 2016-11-11 07:34:34 +01:00 committed by GitHub
parent 0be07af4f4
commit d14b2a8c2c

View File

@ -58,7 +58,7 @@ cp readme.txt readme.bak.txt
Copy `myMusic` folder under `myMedia` folder
```
cp -R myMusic myMedia
cp -a myMusic myMedia
```
## <a id="duplicatefolder"></a>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
```
## <a id="movefile"></a>move a file