1. Kill a process with a specific keyword:
PS-Ef | grep lxs | grep-ev grep | awk '{print $2}' | xargs-t-I kill-9 {}
Or:
Kill-9 $ (PS-Ef | grep lxs | grep-ev grep | awk '{print $2 }')
Change the keyword httpd to the keyword that you need to kill the process.
2. grep filters specific rows, such as empty rows.
Some configuration files are required at work. the command in conf is displayed. to view my. you can use Cat my. CNF | grep-EVN "^ $ | #"
Grep-e extension normalization expression
-V exclusion
-N: number of printed rows
3. Search for rows in a file that do not contain a certain string.
Most of the records in the query logs are correct, but there are also a small number of errors. You need to find these errors. You can do this:
Grep "get packet" Serv. Log> t.txt
Awk '{if ($6! = "Size: 28") Print $0} 't.txt
First, output all rows containing "get packet" in serv. log to t.txt.
In the second sentence, print the rows that do not contain "Size: 28 ".