#> Find.-type f-exec grep 'mingtianc'-l {}\; grep-l: indicates the name of the file that displays the Matching content! The above-mentioned link file type after the find parameter-type,-name '*. c' connection file name-exec executes a program. Or: #> find. -type f-name "*. * "| xargs grep 'xiaoshou '-l (this method is not good, messy, and slow. We recommend the previous method !) 1. Find the row matching the specified string from the file content: $ grep "searched string" file name 2. Find the row matching the regular expression from the file content: $ grep-e "Regular Expression" file name www.2cto.com 3. Case Insensitive during search: $ grep-I "searched string" file name 4. Search for matched lines: $ grep-c "searched string" file name 5. Search for rows that do not match the specified string from the file content: $ grep-v "searched string" file name 6. Search for all extensions from the root directory. log, and find the line "find/-type f-name" * containing "ERROR "*. log "| xargs grep" ERROR "www.2cto.com 7. Example: Search for/SqLogs/access. the log file contains ". method 1 for recording exe "or" TCP_DENIED ": grep/SqLogs/access. lo G-e ". exe "grep/SqLogs/access. log-e "TCP_DENIED" Method 2: find/SqLogs-type f-name access. log | xargs grep ". exe "find/SqLogs-type f-name access. log | xargs grep "TCP_DENIED" because the company uses the SQUID Proxy Server to share the Internet, sometimes for some reason, the new version of the application or financial tax return software will not be available, so only view access. log File, find the reason! Because the LOG file is too large, even though the LOG file is compressed and rebuilt every day, there are too many contents in the LOG file of dozens of MB. It is a waste of time and effort to directly open it and look for it again! Previously, tail-n 100/SqLogs/access was used. log commands are also very difficult to find. The two commands above have helped me a lot, and I can find the problem in a short time! Share with you! Author: zhuizhuziwo