LOGBOOK

HELP

Quiz Entry - updated: 2026.07.05

What are the basic file management commands in Linux?

The core file-management verbs are mkdir (make a directory), cp (copy), mv (move/rename), and rm/rmdir (delete) — short names for the four things you do to files all day.

Two of these have important subtleties worth internalising rather than memorising:

  • mv does double duty. There's no separate "rename" command — renaming is moving a file to a new name in the same directory. mv old.txt new.txt renames; mv file.txt /tmp/ moves. Same command, the destination decides.
  • Directories need recursion. Plain cp and rm act on single files; to handle a folder and its contents you add -r (recursive), which tells the command to walk down into the tree.
mkdir -p a/b/c        # -p makes the whole chain, no error if parts exist
cp -r sourcedir dest  # copy a directory and everything inside it
rm -r directory       # delete a directory and all its contents
rm -f file            # force: no prompts, no error if it's missing

The serious safety point: the Linux CLI has no recycle bin. rm deletes immediately and permanently. The combination rm -rf (recursive + force) deletes an entire tree with zero prompts — incredibly useful and incredibly dangerous in the same breath. Before pressing Enter on any rm -rf, read the path twice; rm -rf / or rm -rf ~ will wipe out everything you have.

Mnemonic: cp = copy, mv = move, rm = remove.

Go deeper:

From Quiz: LIOS / Files and Directories | Updated: Jul 05, 2026