Learning Bash Questions: the MV command

Sam Peterson peabodyenator at gmail.com
Wed Mar 1 04:36:36 UTC 2006


Here's some info to troubleshoot.  Something weird is definitely going
on.  That command should work.

>From the move info page of mv:

`--backup[=METHOD]'
     *Note Backup options::.  Make a backup of each file that would
     otherwise be overwritten or removed.

And in backup options:

`-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 but METHOD is not specified, then the value of the
     `VERSION_CONTROL' environment variable is used.  And if
     `VERSION_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 for METHOD are the same as those used in Emacs.  This
     option also accepts more descriptive names.  The valid METHODs 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 the `SIMPLE_BACKUP_SUFFIX'
     environment variable is used.  And if `SIMPLE_BACKUP_SUFFIX' is not
     set, the default is `~', just as in Emacs.

`--version-control=METHOD'
     This option is obsolete and will be removed in a future release.
     It has been replaced with `--backup'

Keep in mind there is a setting that hides backup files in the "ls"
command.  Is that on?  Via a shell alias perhaps?

>From the info page of ls:

`-B'
`--ignore-backups'
     Do not list files that end with `~', unless they are given on the
     command line.

The clobber setting of bash's doesn't effect mv.

>From the bash info page under the set command:

         `noclobber'
               Same as `-C'.

[...]

    `-C'
          Prevent output redirection using `>', `>&', and `<>' from
          overwriting existing files.


HTH
--
Sam Peterson
peabody at freeshell.org
peabodyenator at gmail.com




More information about the fedora-list mailing list