Код: Выделить всё
olej@orangepione:~$ pgrep -l Xorg
17773 Xorg
Код: Выделить всё
olej@orangepione:~$ pgrep -a Xorg
17773 /usr/lib/xorg/Xorg :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
olej@orangepione:~$
Конечно, эту информацию можно выудить ps ... но зачем так мудрить?
Подробнее, как всегда, здесь:
Код: Выделить всё
olej@R420:~$ pgrep --help
Использование:
pgrep [параметры] <шаблон>
Параметры:
-d, --delimiter <строка> указать разделитель вывода
-l, --list-name выводить PID и имена процессов
-a, --list-full выводить PID и полную командную строку
-v, --inverse negates the matching
-w, --lightweight выводить все TID
-c, --count вывод количества соответствующих шаблону процессов
-f, --full use full process name to match
-g, --pgroup <PGID,...> match listed process group IDs
-G, --group <GID,...> match real group IDs
-i, --ignore-case match case insensitively
-n, --newest select most recently started
-o, --oldest select least recently started
-P, --parent <PPID,...> match only child processes of the given parent
-s, --session <SID,...> match session IDs
-t, --terminal <tty,...> match by controlling terminal
-u, --euid <ID,...> match by effective IDs
-U, --uid <ID,...> match by real IDs
-x, --exact match exactly with the command name
-F, --pidfile <файл> читать PIDы из файла
-L, --logpidfile fail if PID file is not locked
-r, --runstates <state> match runstates [D,S,Z,...]
--ns <PID> match the processes that belong to the same
namespace as <pid>
--nslist <ns,...> list which namespaces will be considered for
the --ns option.
Available namespaces: ipc, mnt, net, pid, user, uts
-h, --help вывести эту справку и выйти
-V, --version вывести информацию и выйти
Подробнее смотрите pgrep(1).