Числовая сортировка по положению символьного поля в поле

Вы можете использовать pkillи pgrep, чтобы уничтожить список имен процессов.

Из справочной страницы:

pgrep looks through the currently running processes and lists the process IDs which matches the selection criteria to stdout. All the criteria have to match. For example, pgrep -u root sshd will only list the processes called sshd AND owned by root. On the other hand, pgrep -u root,daemon will list the processes owned by root OR daemon. pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout.

Пример использования pgrep, pkill,

$ pgrep -l script.sh
12406 script.sh
12425 script.sh

$ pkill $(pgrep script.sh)

$ cat signal-log
Name:./script.sh Pid: 12406 Signal Received: SIGTERM
Name:./script.sh Pid: 12425 Signal Received: SIGTERM
1
17.11.2017, 00:45
0 ответов

Теги

Похожие вопросы