How to move and rename your files on Linux
If you’re new to Linux, you may be wondering how to move and rename files on Linux. Sadly, Linux distributions, even ones aimed at new users, do not go over how to do either of these things. In this guide, we’ll go over moving and renaming your files on Linux.
Moving files around on Linux
Moving files around on Linux can be done in several ways. The terminal can move files using the mv command. Additionally, the Gnome, KDE, XFCE, and Mate desktop environments have file managers that can move files around.
This guide will focus on all significant ways to move files around. To get started, follow the instructions below that corresponds with the Linux method you prefer.
Terminal
Moving files via the terminal seems complex, but it’s pretty easy. To move a file, start by launching a terminal window. Launch a terminal window by pressing Ctrl + Alt + T on the keyboard. Alternatively, you can open up the app menu and launch the terminal.
Now that the terminal window is open, you can use the mv command to move it to a different location. For example, to move the “test” file from the “Documents” directory to the “Desktop” directory, you’d run the following command.
mv ~/Documents/test ~/Desktop/ mv /location/of/file /new/file/location
In addition to moving a single file simultaneously, the mv command can also move multiple files of the same file type at once. For instance, if you’d like to move every JPG file in the “Pictures” directory to the “Desktop” directory, you’d run the following command operation.
mv ~/Pictures/*.jpg ~/Desktop/
Lastly, it is possible to move every file simultaneously from one location to another using the mv command. For example, run the following operation to move every file from the “Videos” directory to the “Documents” directory.
mv ~/Videos/* ~/Documents/
The mv command is compelling and can do a whole lot of things. However, if you’re interested in learning more about the advanced operations it can do, consider checking out the manual entry with the man mv command.
Gnome
Those on the Gnome Shell file manager can move files easily using the Gnome Files file manager. To do it, follow the step-by-step instructions below.
Step 1: Launch the Files app by searching for it in the app menu. Once open, locate the file (or folder) you wish to move and select it with the mouse.
Step 2: Right-click on the file (or folder) with the mouse to open the right-click menu. Then, select the “Move to” option.
Step 3: A pop-up window will appear on the screen when you’ve selected the “Move to” option. Using the window, browse where you’d like to move the file (or folder) to your Linux PC.
KDE
Moving files is best done with the Dolphin file manager in the KDE Plasma desktop. If you use KDE, follow the step-by-step instructions below to move your files.
Step 1: Press the Win button on the keyboard to open up the KDE app launcher. Then, type in “Dolphin” and open the app with the file folder icon.
Step 2: With Dolphin open, go to the location of the file (or folder) you wish to move. Right-click on it to open up the right-click menu when you’ve found it.
Step 3: Select the “Cut” option to put the file (or folder) in your Dolphin clipboard. Then, move to the location where you wish to move the file to. For example, to move the “test” file from /home/user/ to /home/user/Documents/, select the “Documents” folder.
Step 4: Once inside the place where you’d like to put the file, right-click on a blank space. Then, select the “Paste” option in the right-click menu to place the file in the new location.
XFCE
If you use XFCE, you’ll be able to move files around on your desktop using the Thunar file manager. Follow the step-by-step instructions below to move a file.
Step 1: Open up the “Thunar” file manager via the app menu in XFCE. Once open, find the file (or folder) you wish to move. When you’ve found the file, right-click on it with the mouse.
Step 2: After right-clicking on the file, look for the “Cut” option in the right-click menu and select it. This option will place your file (or folder) in the clipboard.
Step 3: In the Thunar file manager, navigate where you wish to paste the file. Then, right-click on open space and select “Paste” to move the file to the new location.
Mate
If you use the Mate desktop, you’ll be able to move files around using the Caja file manager. To move files, start by opening up the Caja file manager. When open, follow the step-by-step instructions below.
Step 1: Move to the location of the file you want to move using Caja. When you’ve located the file, right-click on it with the mouse.
Step 2: In the right-click menu, locate the “Cut” option, and select it with the mouse. This will put your file (or folder) in the Caja clipboard.
Step 3: Move to the location you wish to place the file using Caja and right-click on a blank space. Then, select the “Paste” button to move the file to the new location.
Renaming files
Just like moving files on Linux, renaming files (and folders), renaming files can be done in serval ways, such as through the terminal and Gnome, KDE, XFCE, and Mate file managers.
Terminal
Renaming a file in the terminal is done with the mv command. Here’s how it works. For example, to rename the “test” folder to “files,” enter the following command.
mv test files
The mv file can rename a folder so long as it follows this command formula.
mv /path/to/file /same/path/to/file/with/new/name
Gnome/KDE/XFCE/Mate
The renaming feature is precisely the same in all modern Linux file managers. To rename any file (or folder) in any file manager, do the following.
Step 1: Find the file (or folder) you wish to rename and select it with the mouse.
Step 2: Press the F2 key on the keyboard to tell the file manager you wish to rename the file (or folder).
Step 3: Type in the new file name and press the Enter key to confirm it.