| Red Hat Documentation: man pages: man1: User Commands (1) |
MVSection: User Commands (1)Updated: August 1998 Index NAMEmv - move (rename) filesSYNOPSISmv [option...] source targetmv [option...] source... target POSIX options: [-fi] GNU options (shortest form): [-bfiuv] [-S suffix] [-V {numbered,existing,simple}] [--help] [--version] [--] DESCRIPTIONmv moves or renames files or directories.If the last argument names an existing directory, mv moves each other given file into a file with the same name in that directory. Otherwise, if only two files are given, it renames the first as the second. It is an error if the last argument is not a directory and more than two files are given. Thus, `mv /a/x/y /b' will rename the file /a/x/y into /b/y if /b was an existing directory, and into /b otherwise. Let us call the file a given file is going to be moved into its destination. If destination exists, and either the -i option is given, or destination is unwritable, standard input is a terminal, and the -f option is not given, mv prompts the user for whether to replace the file, writing a question to stderr and reading an answer from stdin. If the response is not affirmative, the file is skipped. When both source and destination are on the same filesystem, they are the same file (just the name is changed; owner, mode, timestamps remain unchanged). When they are on different filesystems, the source file is copied and then deleted. mv will copy modification time, access time, user and group ID, and mode if possible. When copying user and/or group ID fails, the setuid and setgid bits are cleared in the copy. POSIX OPTIONS
GNU DETAILSThe GNU implementation (in fileutils-3.16) is broken in the sense that mv can move only regular files across filesystems.GNU OPTIONS
GNU BACKUP OPTIONSThe GNU versions of programs like cp, mv, ln, install and patch will make a backup of files about to be overwritten, changed or destroyed if that is desired. That backup files are desired is indicated by the -b option. How they should be named is specified by the -V option. In case the name of the backup file is given by the name of the file extended by a suffix, this suffix is specified by the -S option.
GNU STANDARD OPTIONS
ENVIRONMENTThe variables LANG, LC_ALL, LC_COLLATE, LC_CTYPE and LC_MESSAGES have the usual meaning. For the GNU version, the variables SIMPLE_BACKUP_SUFFIX and VERSION_CONTROL control backup file naming, as described above.CONFORMING TOPOSIX 1003.2, except that directory hierarchies cannot be moved across filesystems.NOTESThis page describes mv as found in the fileutils-3.16 package; other versions may differ slightly. Mail corrections and additions to aeb@cwi.nl and aw@mail1.bet1.puv.fi and ragnar@lightside.ddns.org . Report bugs in the program to fileutils-bugs@gnu.ai.mit.edu.
Index
This document was created by using the manual pages. Time: 11:46:34 GMT, March 24, 2025 |
|
© 2001 Red Hat, Inc. All rights reserved. About Red Hat : Legal statement : Privacy statement : Y2K statement : Contact Red Hat |