To rename a file on a computer with a graphical interface, you open a window, find the file you want to rename, click on its name (or right-click and select the option to rename), and then enter a new name.
To rename a file in the terminal, you actually move the file with mv, but you move the file from itself to itself with a new name.
This example renames example.txt to file.txt:
$ mv example.txt file.txt
Because they both use the same command, you can combine rename with a move. For instance, when moving example.txt to Documents, you could also rename it:
$ mv example.txt ~/Documents/file.txt
Comments are closed.