4 ms·
but what's wrong with pgrep -f though? I don't want to search for clever trick every time I need to grep a process
by jackhalford 5y ago
but what's wrong with pgrep -f though? I don't want to search for clever trick every time I need to grep a process
- hddqsb 5y agopgrep is great, but note that you can still encounter this problem if you run pgrep in parallel -- it will never match its own process, but it will match other pgrep processes. So for example if you have a script that uses `pgrep -f banana` to search for a "banana" process, and you run that script twice in parallel, pgrep might see the other pgrep process and think "banana" is running even though it isn't. I was bitten by this :)