[root@localhost demo]# ls aaa a.txt [root@localhost demo]# mv ./a.txt ./aaa #移动文件到另一个文件夹 [root@localhost demo]# ls aaa a.txt [root@localhost demo]# ls aaa
[root@localhost demo]# touch ab.txt [root@localhost demo]# touch ac.txt [root@localhost demo]# touch ad.txt [root@localhost demo]# ls aa.txt ab.txt ac.txt [root@localhost demo]# mkdir dir1 [root@localhost demo]# mv a* ./dir1/ #移动多个文件到另一个文件夹中 [root@localhost demo]# ls dir1/ aa.txt ab.txt ac.txt [root@localhost demo]#
[root@localhost demo]# ls a.txt dir1 [root@localhost demo]# mv a.txt a.txxxt #重命名 [root@localhost demo]# ls a.txxxt dir1
[root@localhost demo]# mv b.txt a.txt #相当于-i参数,覆盖前询问 mv: overwrite ‘a.txt’? n [root@localhost demo]# mv -f b.txt a.txt #强制性覆盖 [root@localhost demo]# ls a.txt dir1标签:demo,mv,ls,常用命令,txt,root,localhost From: https://www.cnblogs.com/wmqxlt/p/18642485