×

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.



This article covers how to use the mkdir command with some examples. In fact, The mkdir command in Linux/Unix allows users to create or make new directories. mkdir stands for "make directory". With mkdir, you can also set permissions, create multiple directories (folders) at once, and much more.



This article covers some useful SCP commands to copy files/folders between hosts in the network. Linux administrator should be familiar with CLI environment. Since GUI mode in Linux servers is not a common to be installed. SSH may the most popular protocol to enable Linux administrator to manage the servers via remote in secure way. Built-in with SSH command there is SCP command. SCP is used to copy file(s) between servers in secure way.



SCP Basic syntax:

scp [options] username1@source_host:/location1/file1 username2@destination_host:/location2/file2

Some common scp command options include:

  • –P – Specify server SSH port.
  • –p – Preserve the timestamp for modification and access (note the lower-case).
  • –q – Quiet mode, don’t display progress or messages (will still show errors).
  • –C – Compress the data during transmission.
  • –r – Recursive – include subdirectories and their contents.




More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com