grep
在本目录搜索后缀和特定文字
grep -nE '\.m$|^\|-' -r ./
grep –n ‘e.?*[1-9][^A-Z]e\<g’ regular.txt //匹配任意一个字符。
Find
查找特定文件
find . -type f -name '*.php'|xargs grep 'GroupRecord'
find . -type f -regex ".*\.c∥h" //当前目录下的所有后缀名时.c或.h的文件
find ./ -name "*.[ch]
find ./ -name "*.java" -o -name "*.xml"
find . -type d | sort
function read_dir(){
for file2 in `ls $1`
do
if [ $file2 == "" ] || [ $file2 == "" ];
then
find_x="1"
fi
done
for file in `ls $1`
do
if [ -d $1"/"$file ]
then
if [ $file == "" ] || [ $file == "" ]
then
else
read_dir $1"/"$file
fi
else
ext=${file##*.}
if [ ext == "m" ] || [ ext == "v" ];
then
fi
fi
done
fi
}