Name

mv [options] source target — coreutils

Synopsis

/bin stdin stdout - file -- opt --help --version

The mv (move) command can rename a file:

$ mv file1 file2

or move files and directories into a destination directory:

$ mv file1 file2 dir3 dir4 destination_directory

Useful options

-i

Interactive mode. Ask before overwriting destination files.

-f

Force the move. If a destination file exists, overwrite it unconditionally.

Get Linux Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.