![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell指令积累
假老练啊哦
男性最大的魅力是幽默
展开
-
shell学习之路
最近处理论文加实验改图改文件让我切实意识到一件事:一门脚本语言(shell)是多么重要。 决定好好学习一下shell,就先积累100个shell使用场景吧。 目的通过场景来积累shell的编写脚本快速解决问题能力,而不仅仅在于一两个语法的掌握。 (1) shell指令积累 知识点:awk,xargs; 场景:删除当前文件夹下所有子文件中的xxx文件。 ...原创 2020-01-14 21:31:19 · 195 阅读 · 0 评论 -
(1) shell指令积累
场景: 当前文件夹A下有若干子文件夹a,b,c,d,...,并且每个子文件夹a,b,c,...,中又包含了一个需要删除的错误文件,假设叫hahah.txt,此时可以写一个.sh脚本文件执行。 dir=$(ls -l . |awk '/^d/ {print $NF}') for i in $dir do cd $i find . -name "hahah.txt"| xargs rm ...原创 2020-01-14 21:07:32 · 189 阅读 · 0 评论