Where to start First steps track · 15 stages
Linux Labs

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.txt rename
  • mv report.txt ~/archive/ move into a directory, same name
  • mv a.txt b.txt docs/ several files into a directory
  • mv project ~/old-project a directory — no options, whole
  • mv -i new.conf app.conf ask before overwriting
  • mv -n new.conf app.conf never overwrite an existing file
  • mv -v *.log /tmp/logs/ print each move
  • mv -b new.conf app.conf the old one becomes app.conf~
  • mv -- -file.txt file.txt a name that starts with a dash

Options

The safety options are the same as in cp: -i, -n, -b. Full list — man mv.

Loading…