Comandos de la terminal/mv

De WikiCabal
Saltar a: navegación, buscar

mv

[rrc@Llawyr ComandosDeLaTerminal]# mv --help
Usage: mv [OPTION]... [-T] SOURCE DEST
  or:  mv [OPTION]... SOURCE... DIRECTORY
  or:  mv [OPTION]... -t DIRECTORY SOURCE...
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.

Mandatory arguments to long options are mandatory for short options too.
      --backup[=CONTROL]       make a backup of each existing destination file
  -b                           like --backup but does not accept an argument
  -f, --force                  do not prompt before overwriting
  -i, --interactive            prompt before overwrite
  -n, --no-clobber             do not overwrite an existing file
If you specify more than one of -i, -f, -n, only the final one takes effect.
      --strip-trailing-slashes  remove any trailing slashes from each SOURCE
                                 argument
  -S, --suffix=SUFFIX          override the usual backup suffix
  -t, --target-directory=DIRECTORY  move all SOURCE arguments into DIRECTORY
  -T, --no-target-directory    treat DEST as a normal file
  -u, --update                 move only when the SOURCE file is newer
                                 than the destination file or when the
                                 destination file is missing
  -v, --verbose                explain what is being done
      --help     display this help and exit
      --version  output version information and exit

The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable.  Here are the values:

  none, off       never make backups (even if --backup is given)
  numbered, t     make numbered backups
  existing, nil   numbered if numbered backups exist, simple otherwise
  simple, never   always make simple backups

Report mv bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info coreutils 'mv invocation'

[rrc@Llawyr ComandosDeLaTerminal]# mv --version
mv (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker, David MacKenzie, and Jim Meyering.

[rrc@Llawyr ComandosDeLaTerminal]# alias mv
alias mv='mv -i'

[rrc@Llawyr ComandosDeLaTerminal]# unalias mv

[rrc@Llawyr ComandosDeLaTerminal]# mv Archivo1 ArchivoMV1

[rrc@Llawyr ComandosDeLaTerminal]# ls -al ArchivoMV1 
-rw------- 1 rrc rrc 24 Apr  4 14:35 ArchivoMV1

[rrc@Llawyr ComandosDeLaTerminal]# mv Archivo2 ArchivoMV1

[rrc@Llawyr ComandosDeLaTerminal]# ls -al ArchivoMV1 
-rw-r--r-- 1 rrc rrc 0 Mar 27 13:27 ArchivoMV1

[rrc@Llawyr ComandosDeLaTerminal]# alias mv='mv -i'

[rrc@Llawyr ComandosDeLaTerminal]# mv SortFile ArchivoMV1 
mv: overwrite ‘ArchivoMV1’? n

[rrc@Llawyr ComandosDeLaTerminal]# mv -f STDERRArchivo ArchivoMV1 

[rrc@pridd ComandosDeLaTerminal]$ su -
Password: 

[root@Llawyr ComandosDeLaTerminal]# mv /var/www/html/richard RichardMV

[root@Llawyr ComandosDeLaTerminal]# ls -al RichardMV/
total 72
drwxrwsr-x  3 rrc  webmin  4096 Apr  4 15:16 ./
drwx------ 19 rrc  rrc     4096 Apr  4 15:18 ../
-rw-r--r--  1 root webmin     0 Apr  4 15:00 DelMe
-rw-r--r--  1 root webmin     0 Apr  4 15:04 DelMe3
-rw-rw-r--  1 rrc  webmin  3320 Jun 25  2008 evolution.es.html
-rw-rw-r--  1 rrc  webmin  3272 Jun 25  2008 evolution.html
drwxrwsr-x  2 rrc  webmin  4096 Jul  8  2008 images/
-rw-rw-r--  1 rrc  webmin 14700 Jul 10  2008 index.es.html
-rw-rw-r--  1 rrc  webmin 13242 Jun 25  2008 index.html
-rw-rw-r--  1 rrc  webmin  4329 Jun 25  2008 RichardSleeve.es.html
-rw-rw-r--  1 rrc  webmin  4328 Jun 25  2008 RichardSleeve.html
-rw-rw-r--  1 rrc  webmin   489 Jun 20  2013 robots.txt

[root@Llawyr ComandosDeLaTerminal]# mv -bu /var/www/html/richard RichardMV
mv: cannot stat ‘/var/www/html/richard’: No such file or directory

[root@Llawyr ComandosDeLaTerminal]# mv -bu RichardMV /var/www/html/richard 
[root@Llawyr ComandosDeLaTerminal]# ls -al /var/www/html/richard
total 72
drwxrwsr-x  3 rrc  webmin  4096 Apr  4 15:16 ./
drwxr-xr-x 20 root root    4096 Apr  4 15:19 ../
-rw-r--r--  1 root webmin     0 Apr  4 15:00 DelMe
-rw-r--r--  1 root webmin     0 Apr  4 15:04 DelMe3
-rw-rw-r--  1 rrc  webmin  3320 Jun 25  2008 evolution.es.html
-rw-rw-r--  1 rrc  webmin  3272 Jun 25  2008 evolution.html
drwxrwsr-x  2 rrc  webmin  4096 Jul  8  2008 images/
-rw-rw-r--  1 rrc  webmin 14700 Jul 10  2008 index.es.html
-rw-rw-r--  1 rrc  webmin 13242 Jun 25  2008 index.html
-rw-rw-r--  1 rrc  webmin  4329 Jun 25  2008 RichardSleeve.es.html
-rw-rw-r--  1 rrc  webmin  4328 Jun 25  2008 RichardSleeve.html
-rw-rw-r--  1 rrc  webmin   489 Jun 20  2013 robots.txt

[root@pridd ComandosDeLaTerminal]# touch /var/www/html/richard/DelMe

[root@Llawyr ComandosDeLaTerminal]# mv -bu /var/www/html/richard/DelMe* .

[root@Llawyr ComandosDeLaTerminal]# ls -al /var/www/html/richard
total 72
drwxrwsr-x  3 rrc  webmin  4096 Apr  4 15:20 ./
drwxr-xr-x 20 root root    4096 Apr  4 15:19 ../
-rw-rw-r--  1 rrc  webmin  3320 Jun 25  2008 evolution.es.html
-rw-rw-r--  1 rrc  webmin  3272 Jun 25  2008 evolution.html
drwxrwsr-x  2 rrc  webmin  4096 Jul  8  2008 images/
-rw-rw-r--  1 rrc  webmin 14700 Jul 10  2008 index.es.html
-rw-rw-r--  1 rrc  webmin 13242 Jun 25  2008 index.html
-rw-rw-r--  1 rrc  webmin  4329 Jun 25  2008 RichardSleeve.es.html
-rw-rw-r--  1 rrc  webmin  4328 Jun 25  2008 RichardSleeve.html
-rw-rw-r--  1 rrc  webmin   489 Jun 20  2013 robots.txt

[root@Llawyr ComandosDeLaTerminal]# ls -al DelMe*
-rw-r--r-- 1 root webmin 0 Apr  4 15:00 DelMe