查找具有特定后缀的文件 #!/bin/sh # find the pdb files at current files. for i in `ls ./*.pdb` do echo $i done 提取文件中某个字符以及下面几行 提取文件中的文字 以前讲过,用grep 或者 gawk 都可以 grep的常用手法: #!/bin/sh grep "要提取的字符" *.txt #提取该文件所有含有该