mv — move or rename
cheat sheet · Ubuntu 24.04 · GNU coreutils 9.4 https://lab.dimsanych.ru/en/wiki/mv/Cheat sheet
-
mv old.txt new.txtrename -
mv report.txt ~/archive/move into a directory, same name -
mv a.txt b.txt docs/several files into a directory -
mv project ~/old-projecta directory — no options, whole -
mv -i new.conf app.confask before overwriting -
mv -n new.conf app.confnever overwrite an existing file -
mv -v *.log /tmp/logs/print each move -
mv -b new.conf app.confthe old one becomes app.conf~ -
mv -- -file.txt file.txta name that starts with a dash
Options
The safety options are the same as in cp: -i, -n, -b. Full list — man mv.