MV--Move
In the same directory, the equivalent of changing the name
[[email protected] ~]# Lsanaconda-ks.cfg[[email protected] ~]# mv anaconda-ks.cfg Anaconda-ks.cfg.1[[email protected] ~] # Lsanaconda-ks.cfg.1
In different directories, it is the mobile location.
Move and change the name
[[email protected] tmp]# ls1.txt allin allin1 ls2 systemd-private-a8472426664940399000bf05f5b4a2c8-vmtoolsd.service-ceavag[[email protected] tmp]# mv 1.txt /root/2.txt[[email protected] tmp]# ls allin allin1 ls2 systemd-private-a8472426664940399000bf05f5b4a2c8-vmtoolsd.service-ceavag[[ Email protected] tmp]# ls /root/2.txt anaconda-ks.cfg.1
move only
[[email protected] tmp]# ls /root/2.txt anaconda-ks.cfg.1[[email Protected] tmp]# mv /root/2.txt /tmp/[[email protected] tmp]# ls 2.txt allin allin1 ls2 Systemd-private-a8472426664940399000bf05f5b4a2c8-vmtoolsd.service-ceavag
Overwrite hint, because alias is visible and comes with -i security options
[email protected] tmp]# which Mvalias mv= ' mv-i '/USR/BIN/MV
[[email protected] tmp]# ls 2.txt allin allin1 ls2 systemd-private-a8472426664940399000bf05f5b4a2c8-vmtoolsd.service-ceavag[[email protected] tmp ]# mv ls2 allin/[[email protected] tmp]# touch ls2[[email protected]  TMP]# MV LS2 ALLIN/MV: Do you want to overwrite "ALLIN/LS2"? y
Some special places.
When moving a directory, when the target directory does not exist, it is equivalent to changing the name
[Email protected] tmp]# ls2.txt Allin Allinlinux Systemd-private-a8472426664940399000bf05f5b4a2c8-vmtoolsd.service-ceavag Tmp[[email protected] tmp]# mv allin/ Allin2/[[email protected] tmp]# ls2.txt allin2 allinlinux SYSTEMD-PRIVATE-A8472426664940399000BF05F5B4A2C8-VMTOOLSD.SERVICE-CEAVAG tmp
This article is from the "Linux Road" blog, make sure to keep this source http://allin28.blog.51cto.com/12931477/1933852
Linux MV Command