I was wondering how I could reduce the amount of grep or pipes used in this command.
ps h -eo pid:1,uid,command | grep -v "screen" | grep java | grep -v "bash" | grep -v "grep"
Could it be reduced?
Is this fit your needs ?
ps h -eo pid:1,uid,command | grep -Ev "screen|bash" | grep '[j]ava'
[j]ava is a known regex trick to avoid using grep -v 'grep'If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With