Analysis:
Kill-15 ' Ps-eaf | Grep-v grep | Grep-i NodeManager | awk ' {print $} '
The meaning of this line of code
1.
About grep:
The grep full name is global Regular Expression Print, which represents the global regular expression version, and its use permissions are all users.
Description: The grep directive is used to find files that contain the specified template style, and if the contents of a file are found to fit the specified template style, the preset grep instruction displays the column that contains the template style. If no file name is specified, or if the given file name is "-", the grep instruction reads the data from the standard input device.
-V Reverse lookup, then grep-v grep means that the rows containing grep characters are filtered out;
-I is case-insensitive, so grep-i NodeManager means: Find rows containing nodemanager;
2.
About awk:
Awk is a powerful text analysis tool that is particularly powerful when it comes to analyzing and generating reports on data, compared to grep lookup and sed editing. To put it simply, awk reads the file line by row, using a space as the default delimiter to slice each row, cut the section, and then perform various analytical processing.
The awk workflow is like this: reads a record with a ' \ n ' newline character split, then divides the record by the specified field delimiter, fills the field, and the $ $ in awk ' {print $n} ' represents all fields, representing the first field, $n representing the nth domain. The default Domain delimiter is the blank key or the [tab] key.
awk ' {print $} ' meaning: Print the second field of the found content;
3.
About PS:
-a displays all processes;
-e equivalent to-A, showing all processes;
-F is all listed, usually used in conjunction with other parameters;
Ps-eaf meaning: Show all processes;
4.
About Kill:
Kill-15 PID, 15 is the normal kill process, PID is the process number;
In Kill-9 PID,-9 is the mandatory kill process, PID is the process number;
In a comprehensive, code
Ps-eaf | Grep-v grep | Grep-i NodeManager | awk ' {print $} '
The meaning is:
Finds all processes with the string "NodeManager" and does not contain the string "grep" and prints the second field of the lookup result (that is, the PID of the process);
Kill-15 ' Ps-eaf | Grep-v grep | Grep-i NodeManager | awk ' {print $} '
The meaning: normal kill all with string "NodeManager" process;