🖥️pgrep
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the pgrep command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██████╗ ██████╗ ███████╗██████╗
# ██╔══██╗██╔════╝ ██╔══██╗██╔════╝██╔══██╗
# ██████╔╝██║ ███╗██████╔╝█████╗ ██████╔╝
# ██╔═══╝ ██║ ██║██╔══██╗██╔══╝ ██╔═══╝
# ██║ ╚██████╔╝██║ ██║███████╗██║
# ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝
#==============================#
# CMD PGREP, egrep, ngrep, fgrep
#==============================##==============================#
pgrep myscript.pl && echo still running || echo "done" | mail admin
# Use the && and || logic operators for results based process control.
pgrep appstreamcli && xdg-open http://bit.ly/appstreamcli
# Ubuntu users, if appstreamcli is running right now, check this URL. 100% CPU bug
pgrep rsync | xargs ionice -c3 -p
# Adjust all rsync processes on the system so that they have lower (idle) IO priority.
pgrep -f bash | while read PMATCH;do echo "$PMATCH # $(grep -e nr_involuntary_switches /proc/$PMATCH/sched|tr -d '\040\011\012\015') # [sysc]:$(ausyscall $(cat /proc/$PMATCH/syscall|cut -d' ' -f1))"; done;
# sched && syscall app state awareness basics
# example or test, basic awareness on app state, mostly for copy-paste reasons, requires auditd (ausyscall), rekt echoing (everything here is rekt) This is sample output
1106 # nr_involuntary_switches:2 # [sysc]:pselect6
1857 # nr_involuntary_switches:3 # [sysc]:wait4
1912 # nr_involuntary_switches:3 # [sysc]:wait4
8901 # nr_involuntary_switches:0 # [sysc]:read
9186 # nr_involuntary_switches:2 # [sysc]:wait4
9238 # nr_involuntary_switches:24 # [sysc]:pselect6
14966 # nr_involuntary_switches:1 # [sysc]:wait4
15054 # nr_involuntary_switches:9 # [sysc]:wait4
21137 # nr_involuntary_switches:0 # [sysc]:wait4
21628 # nr_involuntary_switches:0 # [sysc]:pselect6
22719 # nr_involuntary_switches:0 # [sysc]:pselect6
28808 # nr_involuntary_switches:0 # [sysc]:wait4
30983 # nr_involuntary_switches:0 # [sysc]:wait4
31179 # nr_involuntary_switches:18 # [sysc]:pselect6
#==============================##==============================#
# CMD PGREP, egrep, ngrep, fgrep
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command pgrep in a clear format. This allows users to quickly access the needed information for pgrep without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for pgrep are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.