The mv is a Unix command that renames one or more files or directories. The original filename or directory name is no longer accessible. Write permission is required on all directories and files being modified.
mv Syntax
You need to use the mv command to rename a file as follows:mv old-file-name new-file-name
Examples
Open the terminal (bash shell prompt) and type the following command to list file names:lsIn this example, rename a file called data.txt to letters.txt, enter:
ls -l
mv data.txt letters.txtFile is renamed so the following command will display an error on screen:
ls -l letters.txt
ls -l data.txt
Outputs:ls: cannot access data.txt: No such file or directory
Suggested Readings:
Type the following command to read mv command man page:man mv
No comments:
Post a Comment