$ CLI Academy

Working with Files

Copy, Move & Remove

Manage files safely — especially before using <code>rm</code>.

cp copies. cp file.txt backup.txt or cp -r folder/ backup/ for directories.

mv moves or renames: mv old.txt new.txt.

rm deletes. There is no recycle bin. Use rm -i for prompts, and double-check paths.

Pro tip: type ls on the target path before running rm.

$ Commands to try

$ cp hello.txt hello-backup.txt
$ mv hello.txt renamed.txt
$ rm renamed.txt
$ rm -i *.tmp

Practice exercise

In your practice folder, copy notes.txt to notes-copy.txt, rename the copy to archive.txt, then remove archive.txt.