使用实例
# 查找当前文件夹
find .
# 查找包含.txt的文件
find . | grep .txt
# 只看文件
find . -type f
# 只看目录
find . -type d
# 对查找到的文件使用ls -l命令
find . -type f -exec ls -l '{}' ';'
# 查找文件里是否包含字符串
echo hello > aa
echo Hello >> bb
find . -type f -exec grep hello '{}' ';'
# 打印出目录
find . -type f -exec grep hello '{}' ';' -print
# 打印出行数
find . -type f -exec grep -n hello '{}' ';' -print
# 忽略大小写
find . -type f -exec grep -ni hello '{}' ';' -print