Linux批量创建名称有规则文件
[root@localhost tmp]# pwd /tmp [root@localhost tmp]# touch file_{01..10} [root@localhost tmp]# ll /tmp 总用量 0 -rw-r--r-- 1 root root 0 9月 13 17:15 file_01 -rw-r--r-- 1 root root 0 9月 13 17:15 file_02 -rw-r--r-- 1 root root 0 9月 13 17:15 file_03 -rw-r--r-- 1 root root 0 9月 13 17:15 file_04 -rw-r--r-- 1 root root 0 9月 13 17:15 file_05 -rw-r--r-- 1 root root 0 9月 13 17:15 file_06 -rw-r--r-- 1 root root 0 9月 13 17:15 file_07 -rw-r--r-- 1 root root 0 9月 13 17:15 file_08 -rw-r--r-- 1 root root 0 9月 13 17:15 file_09 -rw-r--r-- 1 root root 0 9月 13 17:15 file_10
同理,删除可使用下列命令
[root@localhost tmp]# rm -f /tmp/file_{01..10}
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。