Basic ps Tips

Liste des GroupesRevenir à cu shell 
Sujet : Basic ps Tips
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.unix.shell
Date : 27. Jul 2024, 01:40:49
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v81fmh$32fuh$5@dont-email.me>
User-Agent : Pan/0.159 (Vovchansk; )
One look at the man page for ps(1)
<https://manpages.debian.org/1/ps.1.en.html> and you see all the
different traditional option syntaxes it tries to be compatible with.
The BSD style doesn’t even prefix options with dashes, which can lead
to ambiguities and is best avoided. If this is what you’re used to,
try to wean yourself off it.

To list some useful info about all processes, you can do

    ps -ef

or, for even more info, try

    ps -eF

One thing I find annoying about this it reports less precision in
process start times for long-running processes. To get around this, you
can use a custom format. For example

    ps -eo pid,ppid,lstart,tty,etime,cmd

shows some similar info to the default “-f” format, but always includes
start time and elapsed time to the nearest second, regardless of how
long the process has been running.

Another useful command to use with ps is pgrep(1)
<https://manpages.debian.org/1/pgrep.1.en.html>, which lets you filter
processes to get information for according to various criteria. Or you
could just use grep(1) on the output from ps, as I suspect a lot of
people do. ;)

Date Sujet#  Auteur
27 Jul 24 * Basic ps Tips22Lawrence D'Oliveiro
30 Jul 24 `* Re: Basic ps Tips21Lawrence D'Oliveiro
2 Aug 24  `* Re: Basic ps Tips20Jerry Peters
2 Aug 24   +- Re: Basic ps Tips1Lawrence D'Oliveiro
3 Aug 24   `* Re: Basic ps Tips18Rene Kita
3 Aug 24    +* Re: Basic ps Tips14Ed Morton
3 Aug 24    i`* Re: Basic ps Tips13Rene Kita
3 Aug 24    i +* Re: Basic ps Tips10Joerg Mertens
4 Aug 24    i i+* Re: Basic ps Tips7Rene Kita
4 Aug 24    i ii`* Re: Basic ps Tips6Joerg Mertens
5 Aug 24    i ii +* Re: Basic ps Tips4Lawrence D'Oliveiro
5 Aug 24    i ii i+* Re: Basic ps Tips2Joerg Mertens
5 Aug 24    i ii ii`- The whole point of the BSDs is to be retro (Was: Basic ps Tips)1Kenny McCormack
5 Aug 24    i ii i`- Re: Basic ps Tips1Christian Weisgerber
5 Aug 24    i ii `- Re: Basic ps Tips1Rene Kita
4 Aug 24    i i`* Re: Basic ps Tips2Christian Weisgerber
5 Aug 24    i i `- Re: Basic ps Tips1Rene Kita
3 Aug 24    i `* Re: Basic ps Tips2Lawrence D'Oliveiro
4 Aug 24    i  `- Re: Basic ps Tips1John D Groenveld
4 Aug 24    `* Re: Basic ps Tips3Christian Weisgerber
4 Aug 24     `* Re: Basic ps Tips2Christian Weisgerber
5 Aug 24      `- Re: Basic ps Tips1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal