recommended:
cp -pR (supported for almost all version) cp -av (gnu shortcut)
Others
cp -pr [-v] (lazy version)
The backup suffix is `~', unless set with --suffix or SIM- PLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values:
numbered, t make numbered backups
touch aaa ab cp --backup=numbered ab aaa cp --backup=numbered ab aaa; cp --backup=numbered ab aaa
$ dir -rw-r--r-- 1 root root 0 Oct 30 20:42 aaa.~1~ -rw-r--r-- 1 root root 0 Oct 30 20:42 ab -rw-r--r-- 1 root root 0 Oct 30 20:46 aaa.~2~ -rw-r--r-- 1 root root 0 Oct 30 20:46 aaa.~3~ -rw-r--r-- 1 root root 0 Oct 30 20:46 aaa
-a, --archive same as -dpR
-b, --backup make backup before removal
-d, --no-dereference preserve links
-f, --force remove existing destinations, never prompt
-i, --interactive prompt before overwrite
-p, --preserve preserve file attributes if possible
-r copy recursively, non-directories as files
-R, --recursive copy directories recursively
-u, --update copy only when the SOURCE file is newer than the desti- nation file or when the destination file is missing
-v, --verbose explain what is being done
documented on: 06-03-99 09:58:32