mv

Linux · Files · available in the simulator

What it does

Move (rename) files and directories.

Syntax

mv [opciones] origen... destino

Options and parameters

  • -i

    Prompt before overwriting.

    mv -i a.txt b.txt
  • -f

    Do not prompt before overwriting.

  • -v

    Explain what is being done.

  • -n

    Do not overwrite an existing file.

  • -u

    Move only when the source file is newer than the destination file.

  • -b

    Make a backup of each existing destination file before overwriting.

Usage examples

  • mv *.txt ../linux
  • mv -i sistemas/* windows
  • mv linux/apuntes.txt linux/RA1.txt
  • mv viejo.txt nuevo.txt
  • mv -i carpeta /tmp/
  • mv -i a.txt b.txt
Practise mv

Related commands