mv的常用命令

[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
posted @   鲁班大师智商二百五  阅读(5)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
历史上的今天:
2022-12-30 安装node.js
2022-12-30 常用命令
点击右上角即可分享
微信分享提示