9.1 S2.9-Mac-terminal-cheatsheet
9.1 S2.9-Mac-terminal-cheatsheet
md 1/17/2022
Copy
cp <file> <newfile> Copy a file to the current folder
cp <file>~/<dir>/<newfile> Copy a file to the folder and rename the
copied file
cp -R <dir> <“new dir”> Copy a folder to a new folder with spaces in the
filename
cp -i <file><dir> Prompts you before copying a file with a warning
overwrite message
cp <file1> <file2> <file3>/Users/<dir> Copy multiple files to a folder```
Remove
rm <file> Delete a file (This deletes the file permanently; use with
caution.)
rm -i <file> Delete a file only when you give confirmation
rm -f <file> Force removal without confirmation
rm <file1> <file2> <file3> Delete multiple files without any confirmation
mv <file> <newfilename> Move/rename
mv <file> <dir> Move a file to the folder, possibly by overwriting an
existing file
mv -i <file> <dir> Optional -i flag to warn you before overwriting the
file
2/2