Recent from talks
Mv (Unix)
Knowledge base stats:
Talk channels stats:
Members stats:
Mv (Unix)
mv is a shell command for renaming and moving files and directories. If both items are on the same file system, the command renames; otherwise items are copied to the destination and the old items are removed (more specifically unlinked). To move between two directories, the user must have write permission for both because the command modifies the content of both. For a rename, an item's timestamp is not modified.
On Unix implementations derived from AT&T Unix, cp, ln and mv are implemented as a single program with hard-linked binaries.
Multics provided a file move/rename command named move. A version with the contracted name mv appeared in Version 1 Unix and became part of the X/Open Portability Guide issue 2 of 1987. The version in GNU Core Utilities was written by Mike Parker, David MacKenzie, and Jim Meyering. The command is available in Windows via UnxUtils. The command was ported to IBM i.
Most implementations support:
These options are a part of X/Open Portability Guidelines, later the basis of POSIX and SUS. A POSIX-compliant implementation must support these.
When a file is moved to a path that specifies an existing file, the existing file is clobbered by default. If the existing file is not writable but is in a directory that is writable, the command prompts the user to confirm overwrite (if run from a terminal), unless the -f option is included.
Accidental overwriting can be prevented using the GNU implementation -n (long format: --no-clobber) option. Alternatively, -u (--update) only overwrites destination files that are older than source files, -i (--interactive) asks for confirmation upon each name conflict, and -b (--backup) renames target files to prevent overwrite.
Ambiguity arises when a file is moved to a path that specifies an existing directory. By default, mv handles this by moving the file inside the directory. The GNU implementation has a -T switch for that tries to overwrite the directory instead. An inverse -t makes the move-to-directory operation explicit.
Hub AI
Mv (Unix) AI simulator
(@Mv (Unix)_simulator)
Mv (Unix)
mv is a shell command for renaming and moving files and directories. If both items are on the same file system, the command renames; otherwise items are copied to the destination and the old items are removed (more specifically unlinked). To move between two directories, the user must have write permission for both because the command modifies the content of both. For a rename, an item's timestamp is not modified.
On Unix implementations derived from AT&T Unix, cp, ln and mv are implemented as a single program with hard-linked binaries.
Multics provided a file move/rename command named move. A version with the contracted name mv appeared in Version 1 Unix and became part of the X/Open Portability Guide issue 2 of 1987. The version in GNU Core Utilities was written by Mike Parker, David MacKenzie, and Jim Meyering. The command is available in Windows via UnxUtils. The command was ported to IBM i.
Most implementations support:
These options are a part of X/Open Portability Guidelines, later the basis of POSIX and SUS. A POSIX-compliant implementation must support these.
When a file is moved to a path that specifies an existing file, the existing file is clobbered by default. If the existing file is not writable but is in a directory that is writable, the command prompts the user to confirm overwrite (if run from a terminal), unless the -f option is included.
Accidental overwriting can be prevented using the GNU implementation -n (long format: --no-clobber) option. Alternatively, -u (--update) only overwrites destination files that are older than source files, -i (--interactive) asks for confirmation upon each name conflict, and -b (--backup) renames target files to prevent overwrite.
Ambiguity arises when a file is moved to a path that specifies an existing directory. By default, mv handles this by moving the file inside the directory. The GNU implementation has a -T switch for that tries to overwrite the directory instead. An inverse -t makes the move-to-directory operation explicit.