mv

Move or rename files and directories.

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

mv moves or renames files. Cross-filesystem moves copy then delete. Use -i for safety in scripts. Unlike cp, the original is always removed after a successful move.

Common flags
FlagMeaning
-i --interactivePrompt before overwriting
-n --no-clobberDo not overwrite existing files
-v --verboseShow what is being moved
-b --backupCreate a backup of each overwritten file
Examples
mv config.yml config.yml.bakRename file as backup before editing · explain & risk-check →
mv -v /tmp/deploy/* /var/www/html/Move all deploy files to web root verbosely · explain & risk-check →
mv -i *.log /archive/logs/Move all log files to archive with overwrite confirmation · explain & risk-check →
Pro tip

Use `mv -b` to auto-create tilde-suffixed backups (~) on overwrite — great for safe config file rotation.

Related
cp rm rename rsync
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man mv for your version. Test destructive commands on a non-production system first.