Copying and moving

  • cp SOURCE DEST copies, so the original stays.
  • mv SOURCE DEST moves, so the original is gone. There's no separate rename command: renaming is just moving to a new name.

If DEST is an existing directory, the file goes inside it and keeps its name.

cp inbox/notes.txt archive
mv inbox/report-draft.txt archive/report.txt
ls archive

Real world: before editing a config, copy it first. cp nginx.conf nginx.conf.bak is cheap insurance.