mv

Moves (renames) a file

mv [options] existing-file new-filename

mv [options] existing-file-list directory

mv [options] existing-directory new-directory

The mv utility, which moves or renames one or more files, has three formats. The first renames a single file with a new filename that you supply. The second renames one or more files so that they appear in a specified directory. The third renames a directory. The mv utility physically moves the file if it is not possible to rename it (that is, if you move it from one filesystem to another).

Arguments

In the first form, the existing-file is a pathname that specifies the ordinary file that you want to rename. The new-filename is the new pathname of the file.

In the second form, the existing-file-list ...

Get A Practical Guide to Red Hat® Linux® 8 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.