grep
Ubuntu 系统 grep 指令
计算行数
加入 -c
参数即可显示行数
cat * | grep -c
参考资料
搜寻目录下指定字串
grep -r "[STRING TO SEARCH FOR]" "[DIRECTORY TO SEARCH]"
grep -r "search text" "/tmp/search/folder"
加入 -c
参数即可显示行数
cat * | grep -c
参考资料
grep -r "[STRING TO SEARCH FOR]" "[DIRECTORY TO SEARCH]"
grep -r "search text" "/tmp/search/folder"