shell遍历文件下所有文件

来源:互联网 发布:英伦 知乎 编辑:程序博客网 时间:2024/04/27 00:58

第一次写,简单一点。

fileName=/home/shell/
filelist=`ls  $fileName|grep 'txt'`;
for fname in $filelist;do
   echo $fname >>down.txt;
done;

原创粉丝点击