cheat-fork-echo/cheat/cheatsheets/cp
Chris Lane d12718b8c4 cp edit
Appended missing newline to end of `cp` cheatsheet.
2017-11-19 08:09:37 -05:00

11 lines
334 B
Text

# Create a copy of a file
cp ~/Desktop/foo.txt ~/Downloads/foo.txt
# 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
# Create a backup file with date
cp foo.txt{,."$(date +%Y%m%d-%H%M%S)"}