Backup options (GNU Coreutils 9.0)
Next: Block size, Previous: Exit status, Up: Common options [Contents][Index]
2.2 Backup options
Some GNU programs (at least cp, install, ln, and mv) optionally make backups of files before writing new versions. These options control the details of these backups. The options are also briefly mentioned in the descriptions of the particular programs.
- ‘
-b’
‘--backup[=method]’ Make a backup of each file that would otherwise be overwritten or removed. Without this option, the original versions are destroyed. Use
methodto determine the type of backups to make. When this option is used butmethodis not specified, then the value of theVERSION_CONTROLenvironment variable is used. And ifVERSION_CONTROLis not set, the default backup type is ‘existing’.Note that the short form of this option,
-bdoes not accept any argument. Using-bis equivalent to using--backup=existing.This option corresponds to the Emacs variable ‘
version-control’; the values formethodare the same as those used in Emacs. This option also accepts more descriptive names. The validmethods are (unique abbreviations are accepted):- ‘
none’
‘off’ Never make backups.
- ‘
numbered’
‘t’ Always make numbered backups.
- ‘
existing’
‘nil’ Make numbered backups of files that already have them, simple backups of the others.
- ‘
simple’
‘never’ Always make simple backups. Please note ‘
never’ is not to be confused with ‘none’.
- ‘
- ‘
-S suffix’
‘--suffix=suffix’ Append
suffixto each backup file made with-b. If this option is not specified, the value of theSIMPLE_BACKUP_SUFFIXenvironment variable is used. And ifSIMPLE_BACKUP_SUFFIXis not set, the default is ‘~’, just as in Emacs.
Next: Block size, Previous: Exit status, Up: Common options [Contents][Index]