Terminal Icon

Moving or renaming a file

To move a file into a different directory, use the mv command. You can also use the mv command to rename a file by "moving" the file into a new file.

For example, to rename the file myFile as secondFile, enter:

mv myFile secondFile

If you specify mv to move a file to a location and a file of the same name already exists there, mv deletes the existing file and overwrites it with the new file.

For more information on moving files, refer to the mv man page by entering: man mv

See also

UNIX

Open this for me

man page for mv