Date: Mon, 5 Nov 2012 11:12:32 -0500 (EST) From: Benjamin Kaduk <kaduk@MIT.EDU> To: Eitan Adler <eadler@freebsd.org> Cc: svn-doc-head@freebsd.org, svn-doc-all@freebsd.org, doc-committers@freebsd.org Subject: Re: svn commit: r39947 - head/en_US.ISO8859-1/books/handbook/basics Message-ID: <alpine.GSO.1.10.1211051110130.2164@multics.mit.edu> In-Reply-To: <201211051316.qA5DGjKG007261@svn.freebsd.org> References: <201211051316.qA5DGjKG007261@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 5 Nov 2012, Eitan Adler wrote: > Author: eadler > Date: Mon Nov 5 13:16:45 2012 > New Revision: 39947 > URL: http://svnweb.freebsd.org/changeset/doc/39947 > > Log: > Prefer the use of pgrep instead of ps | grep for exactly the reason > specified in the handbook: ps is "racy". > > Approved by: jkois > > Modified: > head/en_US.ISO8859-1/books/handbook/basics/chapter.xml > > Modified: head/en_US.ISO8859-1/books/handbook/basics/chapter.xml > ============================================================================== > --- head/en_US.ISO8859-1/books/handbook/basics/chapter.xml Mon Nov 5 11:32:14 2012 (r39946) > +++ head/en_US.ISO8859-1/books/handbook/basics/chapter.xml Mon Nov 5 13:16:45 2012 (r39947) > @@ -2185,20 +2185,12 @@ Swap: 256M Total, 38M Used, 217M Free, 1 > > <step> > <para>Find the process ID of the process you want to send the > - signal to. Do this using &man.ps.1; and &man.grep.1;. The > - &man.grep.1; command is used to search through output, > - looking for the string you specify. This command is run as grep is also a basic Unix command, appropriate to document in a "UNIX Basics" chapter. grep is used in the permissions section, but not documented there. Arguably this text should be moved to the first appearance of 'grep' in this chapter, not removed. -Ben > - a normal user, and &man.inetd.8; is run as > - <username>root</username>, so the <option>ax</option> > - options must be given to &man.ps.1;.</para> > - > - <screen>&prompt.user; <userinput>ps -ax | grep inetd</userinput> > - 198 ?? IWs 0:00.00 inetd -wW</screen> > - > - <para>So the &man.inetd.8; PID is 198. In some cases the > - <literal>grep inetd</literal> command might also appear in > - this output. This is because of the way &man.ps.1; has to > - find the list of running processes.</para> > + signal to. Do this using &man.pgrep.1;.</para> > + > + <screen>&prompt.user; <userinput>pgrep -l inetd</userinput> > +198 inetd -wW</screen> > + > + <para>So the &man.inetd.8; PID is 198.</para> > </step> > > <step> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.GSO.1.10.1211051110130.2164>