Gnu/coreutils/Backup-options
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
method
to determine the type of backups to make. When this option is used butmethod
is not specified, then the value of theVERSION_CONTROL
environment variable is used. And ifVERSION_CONTROL
is not set, the default backup type is ‘existing
’.Note that the short form of this option,
-b
does not accept any argument. Using-b
is equivalent to using--backup=existing
.This option corresponds to the Emacs variable ‘
version-control
’; the values formethod
are the same as those used in Emacs. This option also accepts more descriptive names. The validmethod
s 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
suffix
to each backup file made with-b
. If this option is not specified, the value of theSIMPLE_BACKUP_SUFFIX
environment variable is used. And ifSIMPLE_BACKUP_SUFFIX
is not set, the default is ‘~
’, just as in Emacs.
Next: Block size, Previous: Exit status, Up: Common options [Contents][Index]