您的位置:首页 > 游戏 > 游戏 > app软件开发团队_b2b外贸网站_新闻稿发布软文平台_网络营销课程介绍

app软件开发团队_b2b外贸网站_新闻稿发布软文平台_网络营销课程介绍

2024/11/17 2:27:14 来源:https://blog.csdn.net/m0_49029335/article/details/143099570  浏览:    关键词:app软件开发团队_b2b外贸网站_新闻稿发布软文平台_网络营销课程介绍
app软件开发团队_b2b外贸网站_新闻稿发布软文平台_网络营销课程介绍

Linux批量创建多个文件

1、批量创建文件

root@DESKTOP-OV4EGIC:~/test# touch {1..100}.txt
root@DESKTOP-OV4EGIC:~/test# ls
1.txt    15.txt  21.txt  28.txt  34.txt  40.txt  47.txt  53.txt  6.txt   66.txt  72.txt  79.txt  85.txt  91.txt  98.txt
10.txt   16.txt  22.txt  29.txt  35.txt  41.txt  48.txt  54.txt  60.txt  67.txt  73.txt  8.txt   86.txt  92.txt  99.txt
100.txt  17.txt  23.txt  3.txt   36.txt  42.txt  49.txt  55.txt  61.txt  68.txt  74.txt  80.txt  87.txt  93.txt
11.txt   18.txt  24.txt  30.txt  37.txt  43.txt  5.txt   56.txt  62.txt  69.txt  75.txt  81.txt  88.txt  94.txt
12.txt   19.txt  25.txt  31.txt  38.txt  44.txt  50.txt  57.txt  63.txt  7.txt   76.txt  82.txt  89.txt  95.txt
13.txt   2.txt   26.txt  32.txt  39.txt  45.txt  51.txt  58.txt  64.txt  70.txt  77.txt  83.txt  9.txt   96.txt
14.txt   20.txt  27.txt  33.txt  4.txt   46.txt  52.txt  59.txt  65.txt  71.txt  78.txt  84.txt  90.txt  97.txt

2、批量创建目录

root@DESKTOP-OV4EGIC:~/test# mkdir  {1..100}.txt
root@DESKTOP-OV4EGIC:~/test# ls
1.txt    15.txt  21.txt  28.txt  34.txt  40.txt  47.txt  53.txt  6.txt   66.txt  72.txt  79.txt  85.txt  91.txt  98.txt
10.txt   16.txt  22.txt  29.txt  35.txt  41.txt  48.txt  54.txt  60.txt  67.txt  73.txt  8.txt   86.txt  92.txt  99.txt
100.txt  17.txt  23.txt  3.txt   36.txt  42.txt  49.txt  55.txt  61.txt  68.txt  74.txt  80.txt  87.txt  93.txt
11.txt   18.txt  24.txt  30.txt  37.txt  43.txt  5.txt   56.txt  62.txt  69.txt  75.txt  81.txt  88.txt  94.txt
12.txt   19.txt  25.txt  31.txt  38.txt  44.txt  50.txt  57.txt  63.txt  7.txt   76.txt  82.txt  89.txt  95.txt
13.txt   2.txt   26.txt  32.txt  39.txt  45.txt  51.txt  58.txt  64.txt  70.txt  77.txt  83.txt  9.txt   96.txt
14.txt   20.txt  27.txt  33.txt  4.txt   46.txt  52.txt  59.txt  65.txt  71.txt  78.txt  84.txt  90.txt  97.txt

3、文件批量重命名

替换文件名.bak为空


root@DESKTOP-OV4EGIC:~/test# touch {1..10}.txt.bak
root@DESKTOP-OV4EGIC:~/test# ls
1.txt.bak  10.txt.bak  2.txt.bak  3.txt.bak  4.txt.bak  5.txt.bak  6.txt.bak  7.txt.bak  8.txt.bak  9.txt.bak
root@DESKTOP-OV4EGIC:~/test# rename s/\.bak// *
root@DESKTOP-OV4EGIC:~/test# ls
1.txt  10.txt  2.txt  3.txt  4.txt  5.txt  6.txt  7.txt  8.txt  9.txt
root@DESKTOP-OV4EGIC:~/test#

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com