Stay on top of the latest thoughts, strategies and insights from enterprising peers.
Rename a file in the Linux terminal
To rename a file in the terminal, move the file with mv from itself to itself with a new name. Here's an example.
24 readers like this
24 readers like this
Image by:
CC BY-SA Seth Kenlon
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:
Seth Kenlon is a UNIX geek, free culture advocate, independent multimedia artist, and D&D nerd. He has worked in the film and computing industry, often at the same time. He is one of the maintainers of the Slackware-based multimedia production project Slackermedia.
Comments are closed.