2017-09-13 05:11:38 +02:00
|
|
|
# Create a copy of a file
|
|
|
|
cp ~/Desktop/foo.txt ~/Downloads/foo.txt
|
2017-02-13 04:11:45 +01:00
|
|
|
|
2017-09-13 05:11:38 +02:00
|
|
|
# Create a copy of a directory
|
|
|
|
cp -r ~/Desktop/cruise_pics/ ~/Pictures/
|
|
|
|
|
|
|
|
# Create a copy but ask to overwrite if the destination file already exists
|
|
|
|
cp -i ~/Desktop/foo.txt ~/Documents/foo.txt
|
2017-10-04 16:47:33 +02:00
|
|
|
|
|
|
|
# Create a backup file with date
|
2017-11-19 14:09:37 +01:00
|
|
|
cp foo.txt{,."$(date +%Y%m%d-%H%M%S)"}
|