touch (创建文件或更新时间)
touch file{1..10}
touch file{a.b.c}
touch file{a..z}
cp (文件复制命令)
cp 1.txt /tmp/ cp 1.txt /tmp/2.txt (可多个复制)
cp -p 2.txt /tmp/ (复制文件并保存属性)
cp -r a /tmp (递归,复制目录,将目录下的文件一起复制)
cp -v /etc/hosts /etc/hosts.bak
cp -v /etc{hosts.hosts.bak}
cp -v /etc/hosts{,.bak}
通配符:
? (通配任意单个字符)
* (通配任意多个字符)
[root@oldboy ~]# ls ?.txt
1.txt 2.txt 3.txt
[root@oldboy ~]# ls *.txt
111.txt 112.txt 113.txt 11.txt 12.txt 13.txt 1.txt 2.txt 3.txt
[root@oldboy ~]# ls 1?.txt
11.txt 12.txt 13.txt
mv (剪切,可移目录和文件加重命名)
rm: (可配合通配符)
-r (递归,默认只能删文件,加了可删目录)
-f (强制删除不提醒)
-v (显示过程)
来源:https://blog.csdn.net/starting_now/article/details/98877209