1. Introduction
Ubuntu is a Linux distribution favored by many users for its balance of usability and flexibility. Particularly for developers and system administrators, managing files is one of the routine tasks.
In this article, we explain how to move files in an Ubuntu environment, targeting users from beginners to intermediate. By covering both GUI (Graphical User Interface) and CLI (Command Line Interface) approaches, we enable users to choose the method that fits their skill level or preference.
By reading this article, you will acquire skills such as:
- Simple file moving using GUI
- Flexible operations using the
mvcommand - Precautions and countermeasures for permissions and errors
Now, let’s dive into the detailed methods for moving files on Ubuntu.
2. Moving Files Using the GUI
Ubuntu provides GUI tools to perform file operations intuitively. In this section, we introduce how to move files using the default file manager “Files.”
2.1 Launching the File Manager
The Ubuntu file manager is called “Files.” Here are the steps to launch it:
- Click the “Files” icon in the activity bar on the left.
- Alternatively, press the “Super key” (equivalent to the Windows key), bring up the search bar, type “Files,” and press Enter.
Then the file manager will open, allowing you to visually navigate directories and perform operations.
2.2 Moving Files by Drag & Drop
The simplest way to move files or folders is via drag & drop. Perform the following steps:
- In the file manager, click to select the file(s) or folder(s) you wish to move.
- Open the destination folder in another window or within the same window.
- Drag your selected items, and drop them into the destination.
This will move the selected item(s) to the target location.
2.3 Moving Files via Copy & Paste
Another handy method is to use copy & paste. Please follow these steps:
- Right-click the file you want to move, and select “Cut.”
- Open the target folder, right-click, and select “Paste.”
You can also use keyboard shortcuts:
- Cut:
Ctrl + X - Copy:
Ctrl + C - Paste:
Ctrl + V
This allows efficient operations even if you are less comfortable with mouse operations.

3. Moving Files via Terminal
On Ubuntu, you can move files or folders efficiently using the terminal. In this section, we explain the basic usage of the mv command and useful options.
3.1 Basics of the mv Command
To move files in the terminal, use the mv command. This command stands for “move,” and can also be used to rename files.
Basic syntax:
mv [options] source destination- source: path of the file or folder to move
- destination: path of the target location
Example:
mv file1.txt /home/user/Documents/In this example, file1.txt in the current directory is moved to the Documents folder.
3.2 Moving Files
Move a file to another folder:
mv example.txt /home/user/Desktop/This command moves example.txt to the Desktop folder.
Move multiple files at once:
mv file1.txt file2.txt /home/user/Documents/Here, two files are moved simultaneously into the Documents directory.
3.3 Moving Directories
You can move directories similarly.
Move a folder to another location:
mv folder1 /home/user/Documents/This command moves folder1 into the Documents folder.
Move contents of a folder:
mv folder1/* /home/user/Documents/This moves all files and subfolders inside folder1 into Documents.
3.4 Renaming Files or Directories
Rename a file:
mv oldname.txt newname.txtThis renames oldname.txt to newname.txt.
Rename a folder:
mv oldfolder newfolderThe folder can be renamed similarly.
3.5 Common Options for mv
-i (interactive overwrite confirmation)
mv -i file1.txt /home/user/Documents/If a file with the same name exists at the destination, you will be asked for confirmation before overwriting.
-f (force overwrite)
mv -f file1.txt /home/user/Documents/This overwrites without asking.
-n (no overwrite)
mv -n file1.txt /home/user/Documents/If a file with the same name already exists, the move is skipped.
-v (verbose)
mv -v file1.txt /home/user/Documents/This option prints the process of moving to the console.
By combining these options, you can perform file operations flexibly according to your needs.
4. Precautions and Best Practices
When moving files on Ubuntu, you should pay attention to risks such as overwriting and permissions. In this section, we introduce points to avoid trouble and how to work effectively.
4.1 Overwrite Risk and How to Prevent It
Overwrite risk when moving files:
Using mv, if a file with the same name exists in the destination, it will be overwritten automatically. This can lead to unintended data loss.
Countermeasures:
- Move with overwrite confirmation (
-ioption)
mv -i file1.txt /home/user/Documents/→ You’ll be asked whether to overwrite, making operations safer.
- No overwrite (
-noption)
mv -n file1.txt /home/user/Documents/→ If a same-named file exists, the move is skipped.
- Make a backup before overwriting
cp file1.txt file1_backup.txt→ By backing up beforehand, you can guard against data loss.
4.2 Permission-Related Considerations
Permission errors:
When attempting to move system files or files owned by other users, you may get a “Permission denied” error.
Countermeasures:
- Check file permissions:
ls -l file1.txt→ Check ownership and permissions.
- Change permissions:
sudo chmod 755 file1.txt→ Grant read, write, execute permissions as needed.
- Operate as administrator:
sudo mv file1.txt /etc/config/→ Using sudo grants administrative privileges, but be careful when handling system files.
4.3 Handling Symbolic Links
A symbolic link is a reference (shortcut) to a file or directory. When you move a symlink with mv, only the link itself is moved, not its target.
Be cautious when dealing with links:
mv link1.txt /home/user/Documents/→ Only the link is moved, which may break the link if the target is elsewhere.
Countermeasure:
- If you want to move the actual file, check the link’s target.
ls -l link1.txt- Optionally, copy the actual target before moving:
cp /path/to/target.txt /home/user/Documents/4.4 Moving Between Different Filesystems
When moving across partitions or devices:
The mv command normally performs a “move” operation, but when the source and destination lie on different filesystems, it effectively does a “copy & delete.” For large amounts of data, this behavior requires caution.
Countermeasures:
- Copy first, verify, then delete:
cp -r folder1 /media/usb-drive/
rm -r folder1→ After confirming the data moved, remove the original files.
- Use
rsyncto move:
rsync -av --remove-source-files folder1/ /media/usb-drive/→ This command copies and then deletes the original automatically, which is useful for large datasets.
By understanding these precautions and best practices, you can avoid trouble when moving files and work safely and efficiently.

5. Conclusion
In this article, we have explained how to move files on Ubuntu using both GUI and CLI approaches in detail. We organized the characteristics and advantages of each method to provide useful information for a range of users from beginners to intermediate.
Summary of Key Points
- Using GUI for file movement:
- Use drag & drop or copy & paste to perform operations visually and easily.
- It is intuitive and helps prevent mistakes, making it recommended for beginners.
- Using Terminal (CLI) for file movement:
- Leverage the
mvcommand for advanced operations and batch processing. - Combine options (-i, -f, -n, -v) to minimize risks while performing your tasks.
- Precautions & Best Practices:
- Use options or backups to prevent unintentional overwrites.
- Be mindful about permission errors, handling symbolic links, and cross-filesystem moves; use
sudoorrsyncas appropriate.
Which method should you choose?
- For beginners: The GUI file manager is simple and less error-prone, so it’s preferred.
- For intermediate users and above: Once comfortable with the terminal, CLI-based operations are faster and more flexible. Use CLI especially for bulk data moves or scripted workflows.
Next Steps
Take advantage of this knowledge and learn these advanced skills:
- Writing automation scripts:
Usemvin batch scripts to aim for efficient file management. - Linking with cloud storage:
Connect your Ubuntu environment with Google Drive or Dropbox to learn remote file management. - Using shell scripts:
Automate daily operations or configure regular backups with scripts.
Finally
File management in Ubuntu combines flexibility and efficiency by using both GUI and CLI methods. Use the techniques introduced in this article, and discover which approach best fits your workflow. We will continue delivering useful tips and methods for Ubuntu and Linux topics—please stay tuned!



