Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Mv (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Moving versus copying and removing== Moving files within the same [[file system]] is generally implemented more efficiently than copying the file and then removing the original. On platforms that do not support the <code>[[rename (computing)|rename()]]</code> [[system call]], a new [[hard link]] is added to the new directory and the original one is deleted. The data of the file is not accessed. A [[POSIX]]-conformant system implements {{code|rename()}}. Such an operation is significantly simpler and faster than a copy-and-move operation. The file's [[inode]] number (i-number) does not change. No permission is required to read the file since only cataloguing information is changed. Since the source and target directories are being modified, entries are being created within the target directory and erased from within the source directory, write permission in both directories is required. Moving files from one file system to another may fail entirely or may be automatically performed as an atomic copy-and-delete action; the actual details are dependent upon the implementation. Moving a directory from one parent to a different parent directory requires write permission in the directory being moved, in addition to permissions to modify the old and new parents. This is because the i-number for the directory entry ".." (an alias for the parent of a directory) changes as a result of the rename.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)