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!
==Examples== The following renames file or directory '''foo''' to '''bar'''. This assumes that '''bar''' is not an existing directory beforehand. $ mv foo bar The following moves the file or directory '''foo''' into the existing subdirectory '''subdir''' so that the result is at path '''subdir/foo'''. $ mv foo subdir The following moves the file or directory '''foo''' into directory '''subdir''' with name '''bar''' so that the resulting is path '''subdir/bar'''. This assumes that '''subdir/bar''' is not an existing directory beforehand. $ mv foo subdir/bar The following moves two files/directories, '''foo''' and '''bar''', to existing directory '''subdir'''. $ mv foo bar subdir Copy '''be.03''' to the '''bes''' directory of the [[Mount (computing)|mounted]] volume '''bkup''', then '''be.03''' is removed. In this example, '''/mnt''' refers to the directory (the "mount point") over which a file system is mounted. $ mv be.03 /mnt/bkup/bes Same as above, except each file moved out of '''be.03''' is removed individually instead of all being removed at once after the entire copying is finished. $ mv be.03/* /mnt/bkup/bes The following takes longer than expected if '''/var''' is on a different file system, as it frequently is, since files will be copied and removed. The shell expands <code>~</code> to the user's [[home directory]] and treats <code>*</code> as a [[wildcard character]]. $ mv /var/log/*z ~/logs
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)