{
    "mode": "man",
    "parameter": "MV",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/MV/1/json",
    "generated": "2026-07-05T02:11:15Z",
    "synopsis": "mv [OPTION]... [-T] SOURCE DEST\nmv [OPTION]... SOURCE... DIRECTORY\nmv [OPTION]... -t DIRECTORY SOURCE...",
    "sections": {
        "NAME": {
            "content": "mv - move (rename) files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mv [OPTION]... [-T] SOURCE DEST\nmv [OPTION]... SOURCE... DIRECTORY\nmv [OPTION]... -t DIRECTORY SOURCE...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\nMandatory arguments to long options are mandatory for short options too.\n\n--backup[=CONTROL]\nmake a backup of each existing destination file\n",
            "subsections": [
                {
                    "name": "-b --backup",
                    "content": "",
                    "flag": "-b",
                    "long": "--backup"
                },
                {
                    "name": "-f --force",
                    "content": "do not prompt before overwriting\n",
                    "flag": "-f",
                    "long": "--force"
                },
                {
                    "name": "-i --interactive",
                    "content": "prompt before overwrite\n",
                    "flag": "-i",
                    "long": "--interactive"
                },
                {
                    "name": "-n --no-clobber",
                    "content": "do not overwrite an existing file\n\nIf you specify more than one of -i, -f, -n, only the final one takes effect.\n",
                    "flag": "-n",
                    "long": "--no-clobber"
                },
                {
                    "name": "--strip-trailing-slashes",
                    "content": "remove any trailing slashes from each SOURCE argument\n",
                    "long": "--strip-trailing-slashes"
                },
                {
                    "name": "-S --suffix",
                    "content": "override the usual backup suffix\n",
                    "flag": "-S",
                    "long": "--suffix"
                },
                {
                    "name": "-t --target-directory",
                    "content": "move all SOURCE arguments into DIRECTORY\n",
                    "flag": "-t",
                    "long": "--target-directory"
                },
                {
                    "name": "-T --no-target-directory",
                    "content": "treat DEST as a normal file\n",
                    "flag": "-T",
                    "long": "--no-target-directory"
                },
                {
                    "name": "-u --update",
                    "content": "move only when the SOURCE file is newer than the destination file or when the destina‐\ntion file is missing\n",
                    "flag": "-u",
                    "long": "--update"
                },
                {
                    "name": "-v --verbose",
                    "content": "explain what is being done\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-Z --context",
                    "content": "set SELinux security context of destination file to default type\n\n--help display this help and exit\n",
                    "flag": "-Z",
                    "long": "--context"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n\nThe backup suffix is '~', unless set with --suffix or SIMPLEBACKUPSUFFIX.  The version con‐\ntrol  method  may be selected via the --backup option or through the VERSIONCONTROL environ‐\nment variable.  Here are the values:\n\nnone, off\nnever make backups (even if --backup is given)\n\nnumbered, t\nmake numbered backups\n\nexisting, nil\nnumbered if numbered backups exist, simple otherwise\n\nsimple, never\nalways make simple backups\n",
                    "long": "--version"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Mike Parker, David MacKenzie, and Jim Meyering.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2020 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "rename(2)\n\nFull documentation <https://www.gnu.org/software/coreutils/mv>\nor available locally via: info '(coreutils) mv invocation'\n\n\n\nGNU coreutils 8.32                          January 2026                                       MV(1)",
            "subsections": []
        }
    },
    "summary": "mv - move (rename) files",
    "flags": [
        {
            "flag": "-b",
            "long": "--backup",
            "arg": null,
            "description": ""
        },
        {
            "flag": "-f",
            "long": "--force",
            "arg": null,
            "description": "do not prompt before overwriting"
        },
        {
            "flag": "-i",
            "long": "--interactive",
            "arg": null,
            "description": "prompt before overwrite"
        },
        {
            "flag": "-n",
            "long": "--no-clobber",
            "arg": null,
            "description": "do not overwrite an existing file If you specify more than one of -i, -f, -n, only the final one takes effect."
        },
        {
            "flag": "",
            "long": "--strip-trailing-slashes",
            "arg": null,
            "description": "remove any trailing slashes from each SOURCE argument"
        },
        {
            "flag": "-S",
            "long": "--suffix",
            "arg": null,
            "description": "override the usual backup suffix"
        },
        {
            "flag": "-t",
            "long": "--target-directory",
            "arg": null,
            "description": "move all SOURCE arguments into DIRECTORY"
        },
        {
            "flag": "-T",
            "long": "--no-target-directory",
            "arg": null,
            "description": "treat DEST as a normal file"
        },
        {
            "flag": "-u",
            "long": "--update",
            "arg": null,
            "description": "move only when the SOURCE file is newer than the destination file or when the destina‐ tion file is missing"
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "explain what is being done"
        },
        {
            "flag": "-Z",
            "long": "--context",
            "arg": null,
            "description": "set SELinux security context of destination file to default type --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit The backup suffix is '~', unless set with --suffix or SIMPLEBACKUPSUFFIX. The version con‐ trol method may be selected via the --backup option or through the VERSIONCONTROL environ‐ ment variable. Here are the values: none, off never make backups (even if --backup is given) numbered, t make numbered backups existing, nil numbered if numbered backups exist, simple otherwise simple, never always make simple backups"
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "rename",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/rename/2/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Move or rename files and directories.",
        "examples": [
            {
                "description": "Rename a file or directory when the target is not an existing directory",
                "command": "mv {{path/to/source}} {{path/to/target}}"
            },
            {
                "description": "Move a file or directory into an existing directory",
                "command": "mv {{path/to/source}} {{path/to/existing_directory}}"
            },
            {
                "description": "Move multiple files into an existing directory, keeping the filenames unchanged",
                "command": "mv {{path/to/source1 path/to/source2 ...}} {{path/to/existing_directory}}"
            },
            {
                "description": "Do not prompt for confirmation before overwriting existing files",
                "command": "mv {{-f|--force}} {{path/to/source}} {{path/to/target}}"
            },
            {
                "description": "Prompt for confirmation interactively before overwriting existing files, regardless of file permissions",
                "command": "mv {{-i|--interactive}} {{path/to/source}} {{path/to/target}}"
            },
            {
                "description": "Do not overwrite existing files at the target",
                "command": "mv {{-n|--no-clobber}} {{path/to/source}} {{path/to/target}}"
            },
            {
                "description": "Move files in verbose mode, showing files after they are moved",
                "command": "mv {{-v|--verbose}} {{path/to/source}} {{path/to/target}}"
            },
            {
                "description": "Specify target directory so that you can use external tools to gather movable files",
                "command": "{{find /var/log -type f -name '*.log' -print0}} | {{xargs -0}} mv {{-t|--target-directory}} {{path/to/target_directory}}"
            }
        ]
    }
}