Date: Tue, 27 Aug 2002 07:04:36 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: fred@timogen.com Cc: freebsd-questions@FreeBSD.ORG Subject: Re: pidof command in freebsd Message-ID: <20020827040436.GA1064@hades.hell.gr> In-Reply-To: <003e01c24dfb$0f5d0680$8d05a8c0@fred> References: <003e01c24dfb$0f5d0680$8d05a8c0@fred>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-08-27 11:53 +0000, fred@timogen.com wrote:
> There is a command pidof in linux, which can get the pid of a program.
> Does there are some commands in freebsd which have the same functions?
Yes, ps(1).
You can wrap ps(1) in a shell script if you're looking for program
names though. Try using something like:
charon@hades[07:03]/home/charon$ ps xau | awk '$11 ~ /getty/ {print $2}'
717
718
719
720
721
722
Make that a script, and call it pidof, or whatever you like,
but ps(1) is the ``process status'' program.
--
FreeBSD: The Power to Serve -- http://www.FreeBSD.org
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020827040436.GA1064>
