| ▲ | foobarqux 13 hours ago | |||||||||||||
Their first example is bad:
can be done instead (from memory, not at a Linux machine ATM):
which is arguably better than their solution: | ||||||||||||||
| ▲ | xorcist 13 hours ago | parent | next [-] | |||||||||||||
The commands in their example are not equivalent. The ps | grep thing searches the full command line including argument while ps -C (and, presumably, the psc thing) just returns the process name. Should you for some reason want to do the former, this is easiest done using:
which exists on almost all platforms, with the notable exception of AIX.Their other slightly convoluted example is:
which is much more succinct with: | ||||||||||||||
| ||||||||||||||
| ▲ | mxey 9 hours ago | parent | prev [-] | |||||||||||||
“ss” also has filters, no need for grep ss -o state established '( dport = :ssh or sport = :ssh )' | ||||||||||||||