(一)批量创建文件夹
mkdir -p /testdata/{data,shell}
ll
drwxr-xr-x 2 root root 4096 9月 25 15:28 data1
drwxr-xr-x 2 root root 4096 9月 25 15:28 data2
(二)批量创建文件
touch test{2019-06,2019-07,2019-08}-{01…05}.txt
{2019-06,2019-07,2019-08} 表示 06,07,08三个月 共3个
{01…05} 表示01-05 共5个
ll
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-06-01.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-06-02.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-06-03.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-06-04.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-06-05.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-07-01.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-07-02.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-07-03.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-07-04.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-07-05.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-08-01.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-08-02.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-08-03.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-08-04.txt
-rw-r--r-- 1 root root 0 9月 25 15:20 test2019-08-05.txt
(三)批量删除文件/文件夹
1、全部删除
rm -rf /testdata/data*
rm -rf /testdata/test*
2、批量删除
rm -rf /testdata/data{1,2}
rm -f /testdata/test2019-07-{01…04}.txt
ll
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-06-01.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-06-02.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-06-03.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-06-04.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-06-05.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-07-05.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-08-01.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-08-02.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-08-03.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-08-04.txt
-rw-r--r-- 1 root root 0 9月 25 15:34 test2019-08-05.txt