terminal.cab

All commands

mv

Topic: Files and folders

Program: mv

Moves or renames files.

Package: core-files

Usage

mv [OPTION]... SOURCE... DEST

Description

Give SOURCE the new name DEST. If DEST is a directory, put every SOURCE into it.

Options in the simulator

13 more options of the real program, not in the simulator yet
  • --backup value optional not in the simulator yet

    Explanation to come

  • -b not in the simulator yet

    Explanation to come

  • --debug not in the simulator yet

    Explanation to come

  • --exchange not in the simulator yet

    Explanation to come

  • --no-copy not in the simulator yet

    Explanation to come

  • --strip-trailing-slashes not in the simulator yet

    Explanation to come

  • -S, --suffix needs a value not in the simulator yet

    Explanation to come

  • -t, --target-directory needs a value not in the simulator yet

    Explanation to come

  • -T, --no-target-directory not in the simulator yet

    Explanation to come

  • --update value optional not in the simulator yet

    Explanation to come

  • -u not in the simulator yet

    Explanation to come

  • -Z, --context not in the simulator yet

    Explanation to come

  • --version not in the simulator yet

    On a real system it prints the version of the program.

Examples

From the lesson Copying, moving and renaming
mv Downloads/photo.jpg Pictures/
ls Pictures
cat.jpg  photo.jpg

Try it in the terminal

From the lesson Copying, moving and renaming
mv Downloads/invoice.pdf Downloads/invoice-october.pdf
ls Downloads
invoice-october.pdf  photo.jpg

Try it in the terminal

From the lesson Final scenario: tidying up Downloads
mkdir Downloads/invoices
mv Downloads/invoice-*.pdf Downloads/invoices/
ls Downloads/invoices
 invoice-2026-08.pdf  'invoice-2026-10(1).pdf'
 invoice-2026-09.pdf   invoice-2026-10.pdf

Try it in the terminal

From the lesson Create, copy, move
mv notes.txt todo.txt
mkdir old
mv todo.txt old/
ls old
todo.txt

Try it in the terminal

From the command of the day: mv to rename
mv Documents/report.txt Documents/report-2026.txt
ls Documents
notes.txt  report-2026.txt

Try it in the terminal

Where you learn it

Lessons

Command of the day

All commands