linux常用指令(拷贝移动命令)

(1).cp--复制

cp hello.txt itcast/       -- 将hello.txt复制到itcast目录中
cp hello.txt ./hi.txt      -- 将hello.txt复制到当前目录,并改名为hi.txt
cp -r itcast/ ./itheima/   -- 将itcast目录和目录下所有文件复制到itheima目录下
cp -r itcast/* ./itheima/  -- 将itcast目录下所有文件复制到itheima目录下
                -- -r:表示对目录递归复制

 (2).mv--移动

mv hello.txt hi.txt -- 将hello.txt改名为hi.txt(移动hello.txt到当前位置,并重命名=重命名)
mv hi.txt itheima/ -- 将文件hi.txt移动到itheima目录中
mv hi.txt itheima/hello.txt -- 将hi.txt移动到itheima目录中,并改名为hello.txt
mv itcast/ itheima/ -- 如果itheima目录不存在,将itcast目录改名为itheima
mv itcast/ itheima/ -- 如果itheima目录存在,将itcast目录移动到itheima目录中

 

posted @   Davis·Hisa  阅读(2481)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· DeepSeek在M芯片Mac上本地化部署
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
点击右上角即可分享
微信分享提示