Deutsch English Français Italiano |
<v8bja7$16ghh$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: comp.unix.shell Subject: Re: Basic ps Tips Date: Tue, 30 Jul 2024 20:43:52 -0000 (UTC) Organization: A noiseless patient Spider Lines: 13 Message-ID: <v8bja7$16ghh$1@dont-email.me> References: <v81fmh$32fuh$5@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 30 Jul 2024 22:43:52 +0200 (CEST) Injection-Info: dont-email.me; posting-host="1fbb37dbc5397d698139d650eacef59c"; logging-data="1262129"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bCUNA8+qTKspDiMklrQAj" User-Agent: Pan/0.159 (Vovchansk; ) Cancel-Lock: sha1:a9VqEsZsIFxKHmcT5jEfpVKovo4= Bytes: 1478 On Sat, 27 Jul 2024 00:40:49 -0000 (UTC), I wrote: > Another useful command to use with ps is pgrep(1) > <https://man7.org/linux/man-pages/man1/pgrep.1.html> If you are expecting more than one process to match your criteria, it is easy enough to use the “-d,” option to comma-separate them. Then the output becomes acceptable to the “-p” option in ps, e.g. ps -p$(pgrep -d, bash) -wwo pid,ppid,lstart,tty,etime,cmd to report all the bash sessions I have running (quite a lot). The “ww” says not to truncate the output, which is handy for long command lines.