How to move folder in linux

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: In Linux, you can move a folder using the `mv` command in the terminal. Simply type `mv /path/to/source_folder /path/to/destination_folder` to move the folder and its contents. Alternatively, graphical file managers like Nautilus or Dolphin allow you to drag and drop folders.

Key Facts

Overview

Moving a folder, also known as a directory, in Linux is a fundamental operation for organizing your files. Whether you're using the command line or a graphical interface, Linux provides straightforward methods to relocate directories and their contents. Understanding how to move folders efficiently is crucial for maintaining a tidy and accessible file system.

Using the Command Line: The `mv` Command

The most common and powerful way to move folders in Linux is through the terminal using the `mv` command. The `mv` command is a versatile utility that stands for 'move'. It's primarily used for two purposes: moving files and directories from one location to another, and renaming them.

Basic Syntax

The general syntax for moving a directory is:

mv [options] source_directory destination_directory

Examples:

1. Moving a folder to another directory:

Suppose you have a folder named `documents` in your home directory (`~/`) and you want to move it into a folder named `backup` which is also in your home directory. You would use the following command:

mv ~/documents ~/backup/

After this command, the `documents` folder will no longer be in your home directory; it will be located inside the `backup` folder.

2. Moving and renaming a folder simultaneously:

The `mv` command can also rename a folder as you move it. If you want to move the `documents` folder from your home directory to the `backup` directory and rename it to `old_docs` in the process, you would do:

mv ~/documents ~/backup/old_docs

This command moves the `documents` folder into `backup` and renames it to `old_docs`.

3. Moving a folder to the current directory:

If you are currently in the `backup` directory and want to move a folder named `reports` from a parent directory (`../`) into your current location, you can use:

mv ../reports .

The `.` symbol represents the current directory.

Important Considerations with `mv`

Using Graphical File Managers

For users who prefer a visual approach, Linux desktop environments come with graphical file managers. Popular examples include Nautilus (GNOME), Dolphin (KDE), Thunar (XFCE), and Caja (MATE).

Drag and Drop

The most intuitive method is using the drag-and-drop functionality:

  1. Open two file manager windows.
  2. In the first window, navigate to the folder you want to move.
  3. In the second window, navigate to the destination directory where you want the folder to end up.
  4. Click and hold the left mouse button on the folder you wish to move.
  5. Drag the folder from the source window to the destination window.
  6. Release the mouse button.

Most file managers will move the folder. Sometimes, especially when dragging between different drives or partitions, you might be prompted if you want to move or copy. Holding down modifier keys like `Shift` might force a move, while `Ctrl` might force a copy, but this behavior can vary.

Cut and Paste

You can also use the traditional cut and paste method:

  1. Right-click on the folder you want to move and select 'Cut' (or use the keyboard shortcut, often `Ctrl+X`).
  2. Navigate to the destination directory.
  3. Right-click in an empty space within the destination directory and select 'Paste' (or use the keyboard shortcut, often `Ctrl+V`).

The folder will be moved from its original location to the new one.

Choosing the Right Method

The choice between the command line and a graphical file manager often comes down to personal preference and the specific task:

Both methods achieve the same result: relocating your folders. Understanding both will make you a more proficient Linux user.

Sources

  1. mv(1) - Linux man pageCC0-1.0
  2. Moving files and directories - Ubuntu Tutorialsfair-use
  3. Moving and renaming files - GNU Coreutils ManualGPL-3.0-or-later

Missing an answer?

Suggest a question and we'll generate an answer for it.