Skip to main content
Kill -9 Club
Sign in

mv

FilesPackage: coreutils

Moves or renames. On the same filesystem it is an instant rename, which is what makes switching a current link atomic; across two disks it is a copy followed by a delete.

What its options do in the lessons

From the same glossary the lessons render under their commands, so the two cannot disagree.

mv -i
Asks before replacing an existing file.
mv -n
Never replaces an existing file.
mv -f
Replaces the destination without asking. In an atomic replacement it is what keeps the mv a single operation: without it an interactive mv waits for an answer nobody will give inside a script.
mv -T
Treats the destination as a file rather than as a directory to move into, which avoids landing *inside* the target by accident.

Lessons that teach it

mv — command reference | Kill -9 Club