1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

pgrep: Add -O option to filter processes by age

This option allows the user to specify a number of seconds. Only
processes older than the given number of seconds are selected.
This commit is contained in:
Tim Ledbetter 2023-06-09 18:06:19 +01:00 committed by Andreas Kling
parent d03aaddb55
commit b863332415
2 changed files with 23 additions and 1 deletions

View file

@ -5,7 +5,7 @@ pgrep - look up processes based on name
## Synopsis
```sh
$ pgrep [--count] [-d delimiter] [--ignore-case] [--list-name] [--newest] [--oldest] [--uid uid-list] [--invert-match] [--exact] <process-name>
$ pgrep [--count] [-d delimiter] [--ignore-case] [--list-name] [--newest] [--oldest] [--older seconds] [--uid uid-list] [--invert-match] [--exact] <process-name>
```
## Options
@ -16,6 +16,7 @@ $ pgrep [--count] [-d delimiter] [--ignore-case] [--list-name] [--newest] [--old
* `-l`, `--list-name`: List the process name in addition to its pid
* `-n`, `--newest`: Select the most recently created process only
* `-o`, `--oldest`: Select the least recently created process only
* `-O`, `--older`: Select only processes older than the specified number of seconds
* `-U uid-list`, `--uid uid-list`: Select only processes whose UID is in the given comma-separated list. Login name or numerical user ID may be used
* `-x`, `--exact`: Select only processes whose names match the given pattern exactly
* `-v`, `--invert-match`: Select non-matching lines