First, Find
1) Delete files in bulk
Find " *.h~ " RM ' {}' \;
2) Locate a file line
Find/-name "demo.conf" | Egrep-v "Default" | Xargs grep-n "Demo" | head-1 | cut-d "/"-F 4
3) Find a first-level directory
Find/-type d-maxdepth 1-mindepth 1 | Egrep-v "(Default|global|htdoc)
4) Replace the file with a line
Find/-name "demo.conf" | Egrep-v "Default" | Xargs sed-i ' i/demo/demo:test/g '
5) Insert content after a line in the file
Find/-name "demo.conf" | Xargs sed-i "$ (Find/-name" demo.conf "| egrep-v" Default "| Xargs grep-n" Demo " | head-1 | cut-d": "-F 4) ' Ade Mo\ndemo '
Reference: http://blog.jobbole.com/48931/
Second, Grep
grep get_default_error_string *-rfn--binary-files=without-match
Third, regular expression
http://www.cnblogs.com/yirlin/archive/2006/04/12/373222.html
http://www.jb51.net/article/31235.htm
Linux Find/grep Commands