On Tue, Jul 05, 2016 at 01:51:48PM -0700, Rick Stevens wrote:
> On 07/05/2016 01:36 PM, Joe Zeff wrote:
> > On 07/05/2016 11:35 AM, Rick Stevens wrote:
> >> Yeah, I use that one a lot, too. "pidof -x" is useful as well and you
> >> don't need the greps.
> > 
> > One of the wonderful things about *nix is the fact that there are so
> > many different ways to get exactly the same results, depending on
> > personal preference.
> 
> Since "pidof" doesn't do the grep, so you need to specify the entire
> process name (e.g. "pidof chron" gets nothing, "pidof chronyd" gets the
> PID of the chronyd process).
> 
> In that sense, your "ps aux | grep | grep -v grep" is a more flexible
> in that you only need to know part of the process name. I use it a lot
> myself--but not to the point of turning it into a script/utility. :)

There is also "pgrep"

$ pgrep chronyd
1542

$ pgrep chron
1542

$ pgrep fire
1535
8708
21777

$ pgrep -l fire
1535 firewalld
8708 firewall-applet
21777 firefox

$ pgrep -a fire
1535 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
8708 /usr/bin/python -Es /usr/bin/firewall-applet
21777 /usr/lib64/firefox/firefox

Jon
-- 
Jon H. LaBadie                  jo...@jgcomp.com
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

Reply via email to