1. The set command can display all global parameter definitions and their values under the current shell; 2. Find and delete small files in the current directory: Find. -type f-size-10k-exec rm {} \; Description: Www.2cto.com-type f Find File-size-10k, less than 10k. "+" indicates that the system is required to list only files larger than the specified size, while using "-" indicates that the system is required to list files smaller than the specified size. 3. Traverse the folder grep a string find. -name "*c" | Xargs grep "Strings" in all C files under the current folder look for string "strings"
4. Locate a string in the file in a directory grep-r Youcode dir For example: Find Hellogrep-r in the file under Home Hello/home for example: Find hello in Files in all current directories, case-insensitive grep-ir hello. www.2cto.com from file content lookup matches the specified string of lines: $ grep "search string" file name from file contents Lookup line matching Regular expression: $ grep–e "Regular expression" file name lookup when case-insensitive: $ grep–i " Search string "File name lookup matching line number: www.2cto.com $ grep-c" search string "file name from file content lookup does not match the line of the specified string: $ grep–v" search string "file name starting from the root directory search Have a text file with a. log extension and find the line that contains "ERROR"
Commands for finding strings under Linux