When extracting a process that contains an arbitrary character string when checking the process
ps aux | grep target
Then
mochimochi 18277 248 1.4 1122692 367144 ? Sl 21:18 0:39 ./target_process
mochimochi 18294 231 1.5 1253764 373160 ? Sl 21:18 0:34 ./target_process
root 18565 0.0 0.0 112828 972 pts/0 S+ 21:19 0:00 grep --color=auto target
It is a subtle obstacle that the command hitting myself is also listed So use the v option (exclusion)
ps aux | grep target | grep -v grep
Specify grep as a grep exclusion target while including the target character string
mochimochi 18277 248 1.4 1122692 367144 ? Sl 21:18 0:39 ./target_process
mochimochi 18294 231 1.5 1253764 373160 ? Sl 21:18 0:34 ./target_process
Recommended Posts