Linux系统中如何一次创建和删除多个文件/文件夹
1.创建/删除多个文件
//连续创建5个文件,文件名为file1、file2、..file5
[[email protected] ~]# touch file{1..5}
[[email protected] ~]# ls
anaconda-ks.cfg Downloads file3 hello install.log Pictures test
Desktop file1 file4 hello.c install.log.syslog Public Videos
Documents file2 file5 hello.o Music Templates
[[email protected] ~]# rm -rf file*
2.创建/删除多个目录
[[email protected] ~]# mkdir folder{1..5}
[[email protected] ~]# ls
anaconda-ks.cfg file1 file5 folder4 hello.o Pictures Videos
Desktop file2 folder1 folder5 install.log Public
Documents file3 folder2 hello install.log.syslog Templates
Downloads file4 folder3 hello.c Music test
[[email protected] ~]# rm -rf folder*
[[email protected] ~]# ls
anaconda-ks.cfg Downloads file3 hello install.log Pictures test
Desktop file1 file4 hello.c install.log.syslog Public Videos
Documents file2 file5 hello.o Music Templates
原文地址:https://blog.51cto.com/9664355/2453125
时间: 2024-12-11 02:58:46