How to fast search for specified content in large files in linux
In linux, to search for specified content in large files, we can use tail -c or head -c commands....
How to find all files containing specific text on Linux?
In linux, to find all files containing a specific text, we can use the grep command, which can search for the specified text in the...
How to delete empty lines in a text file in linux/unix
To delete blank lines in a text file, you can use awk NF variable, awk regular expression, sed regular expression and grep -v '^$'...
How to delete lines containing a specific string in a text file in linux/unix
Delete lines containing a specific string in a text file, we have three implementation methods: sed -i '/ pattern/d', grep -v 'pattern' and awk '!/pattern/...
grep command tutorial in linux/unix with examples and use cases
linux grep command – print lines that match patterns Linux grep searches for PATTERNS in each FILE. PATTERNS is one or patterns separated by newline...
AWK tutorial: find and kill process use awk
Step 1. View the process ID pid of the top command.
Step 2. Use the awk command to get the process ID.
Step 3. Use...
grep multiple words/patterns/strings, and/or condition, use -e or regex
grep multiple words You can use grep -e parameters and pipes ("|") to implement grep multiple words "and" query, "or" query ......
linux grep process by name/by id and kill example, and grep -v example
linux grep process
- grep process name;
- grep process by port;
- grep process id and kill;
- grep process without itself;
-...
How to count using the grep command in Linux/Unix
linux grep count * ; - grep count lines; - grep count words; - grep count files; - grep count sort; - grep two words...
linux grep command – grep not include, grep reverse match
There is also a case where we need to exclude certain content when we do content search. How to achieve it? Still linux grep command!...
linux grep command – grep only show match
When we search for content, sometimes we just need to show matching content. At this time we can use the grep command. linux grep You...
linux grep command – grep multiple patterns
The last article 《grep or condition, grep and condition》 introduced grep and, or use, including the use of the -e parameter. Here is a detailed...
grep show lines before and after
Usually when searching for keywords, we need to look at the keyword context information, all of which use -A, -B and -C parameters. Show num...
linux grep regex examples
Grep regex matches the search content according to the specified rule pattern, which can help us find the content we need precisely. Syntax: grep -E...
linux find command tutorial: find syntax and examples
linux find – search for files in a directory hierarchy. syntax examples use find command – find file find – type filter explanation where x...