linux_mv(用法分类和常用选项)
文章目录
overview
though the mv
command performs both file moving and file renaming,however,we could look it with a unified way:
with the effect of the mv,the name1 file/directory will no looger exist ,and the name2 file/directory will be exist.
mv file1 file2
将文件1移动到File2。 如果存在File2,则将其与File1的内容覆盖。 如果File2不存在,则会创建它。 在任何一种情况下,File1都不再存在。
Move file1 to file2. If file2 exists, it is overwritten with the contents of file1. If file2 does not exist, it is created. In either case, file1 ceases to exist.
mv -i file1 file2 (saver usage version)
Same as the previous command, except that if file2 exists, the user is prompted before it is overwritten.
mv dir1 dir2
If directory dir2 does not exist, create directory dir2 and move the contents of directory dir1 into dir2 and delete directory dir1.
(ok,you can consider it as rename the directory! at least ,the finally result is “the dir1 is renamed” )
If directory dir2 does exist, move directory dir1
(and its contents) into directory dir2.
mv file1 file2 dir1
Move file1 and file2 into directory dir1. The dierctory dir1 must already exist.
useful options
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2022-08-12 C++全局重载运算符访问类的私有变量(友元)/以“+“为例(交换律)