🖥️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.

▁ ▂ ▃ ▄ ꧁ 🔴☠ 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
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░