語法:
[root@www ~]# mv [-fiu] source destination [root@www ~]# mv [options] source1 source2 source3 .... directory
選項與參數:
- -f :force 強制的意思,如果目標文件已經存在,不會詢問而直接覆蓋;
- -i :若目標文件 (destination) 已經存在時,就會詢問是否覆蓋!
- -u :若目標文件已經存在,且 source 比較新,才會升級 (update)
復制一文件,創建一目錄,將文件移動到目錄中
[root@www ~]# cd /tmp [root@www tmp]# cp ~/.bashrc bashrc [root@www tmp]# mkdir mvtest [root@www tmp]# mv bashrc mvtest
將某個文件移動到某個目錄去,就是這樣做!
將剛剛的目錄名稱更名為 mvtest2
[root@www tmp]# mv mvtest mvtest2