×


Related to mv command in linux to rename


Mv Command in Linux - Explained with Examples

This article covers how to use the mv command in Linux.


mv command Options

  • --backup[=vcm]: Make a backup of each existing destination file, using the version control method vcm. If vcm is omitted, --backup behaves the same as -b (backups are created, using the default version control method). See backing up files for details.
  • -b: Like --backup, but does not accept a backup method. Instead, the method specified by the VERSION_CONTROL environment variable is used. Simple backups are created if the variable is not set. See version control methods for details.
  • -f, --force: Always overwrite existing files without prompting. This can be useful if you need to overwrite multiple files whose permissions are read-only; if you don't specify -f, you are prompted for every file.
  • -i, --interactive: Prompt before overwriting an existing file, regardless of the file's permissions.
  • -n, --no-clobber: Never overwrite any existing file.
  • --strip-trailing-slashes: Remove any trailing slashes from each source argument.
  • -S, --suffix=suffix: Specify the file name suffix to be used for all backup files. The default is "~".
  • -t,
  • --target-directory=destination: Move all sources into the directory destination.
  • -T, --no-target-directory: Treat destination as a normal file, not as a directory.
  • -u, --update: Don't overwrite files if they're newer. A move only happens if the destination file is older than the source file, or the destination file does not already exist.
  • -v, --verbose: Provide verbose output. Print the name of every file moved.
  • --help: Display a help message, and exit.
  • --version: Display version information, and exit.