Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. pgrep - Teknopedia
pgrep - Teknopedia

pgrep (acronimo di process grep) è un comando dei sistemi operativi Unix e Unix-like che consente di effettuare particolari filtraggi e rappresentazioni dei PID dei processi in esecuzione, in modo più flessibile rispetto al comando ps. Il comando viene usato in tandem con pkill destinato ad inviare segnali ai processi in esecuzione.

Sintassi

[modifica | modifica wikitesto]
pgrep [-flvx] [-d delimiter] [-n|-o] [-P ppid,...] [-g pgrp,...]
	    [-s sid,...] [-u euid,...] [-U uid,...] [-G gid,...]
	    [-t term,...] [pattern]

Le opzioni del comando consentono sia di specificare elementi di filtraggio (ad esempio -P, -U) che di rappresentazione dell'outupt (-d).

L'attributo pattern serve per identificare il nome del programma in esecuzione, anche utilizzando espressioni regolari.

Esempi di utilizzo

[modifica | modifica wikitesto]

Elenco dei processi in esecuzione di proprietà dell'utente root. L'opzione -d consente di separare i vari PID con una virgola in luogo del newline.

$ pgrep -u root -d ", "
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 
32, 33, 34, 35, 36, 37, 38, 39, 47, 48, 49, 50, 51, 52, 53, 54, 55, 240, 241, 242, 243, 258, 266, 267, 313, 
314, 315, 348, 376, 379, 597, 657, 807, 825, 860, 891, 899, 912, 921, 991, 996, 1032, 1041, 1057, 1063, 1077, 
1081, 1084, 1092, 1101, 1232, 1247, 1290, 1405, 1416, 1418, 1516, 1920, 1921, 2165, 2646, 2647, 2713, 2719, 
2764, 3161, 5781

È anche possibile utilizzare il pattern per elencare i processi in base al nome dell'eseguibile. Nel seguente esempio sono elencati tutti i processi dell'utente test il cui eseguibile ha un nome che inizia per gnome

pgrep -u test gnome* -d ", "
2814, 2859, 2865, 2891, 2893, 3045, 5254, 5258

Interessante confrontare il risultato dell'esempio precedente con il risultato di una combinazione dei comandi ps e grep

$ ps aux |grep "^test"|grep gnome
test      2814  0.0  0.7  35468  7664?        Ssl  20:26   0:00 gnome-session
test      2859  0.0  1.0  73420 11160?        Sl   20:26   0:00 gnome-power-manager
test      2891  0.0  2.1  84732 21556?        Sl   20:26   0:02 gnome-panel
[...]

Collegamenti esterni

[modifica | modifica wikitesto]
  • (EN) pgrep lookup processes based on name and other attributes, in Unix man pages. URL consultato il 24-08-2011 (archiviato dall'url originale il 7 gennaio 2013).
V · D · M
Programmi Unix/Unix-like con interfaccia a riga di comando e comandi interni della shell unix
File systemcat · cd · chattr · chmod · chown · chgrp · cksum · cmp · cp · du · df · fdisk · file · fsck · fuser · gzip · ln · ls · lsattr · lsof · mkdir · mknod · mount · mv · pwd · rm · rmdir · split · tar · touch · umount · umask
Processiat · chroot · crontab · exit · kill · killall · nice · nohup · pgrep · pidof · pkill · ps · pstree · sleep · time · top · wait
Ambiente utentealias · env · export · finger · id · logname · mesg · newgrp · passwd · su · sudo · uname · uptime · w · wall · who · whoami · write
Elaborazione testoawk · comm · cut · diff · ed · ex · fmt · head · iconv · join · less · more · paste · sed · sort · tail · tr · uniq · vi · wc · xargs
Script di shellbasename · dirname · echo · expr · false · printf · test · true · unset
Retedig · nslookup · ifconfig · netstat · ping · rcp · rlogin · route · netcat · traceroute
Ricerchefind · grep · strings
Amministrazionedmesg · groupadd · groupdel · groupmod · mdadm · shutdown · useradd · userdel · usermod
Altribanner · bc · cal · clear · date · dd · lp · man · size · tee · tput · yes
  Portale Sicurezza informatica: accedi alle voci di Teknopedia che trattano di sicurezza informatica
Estratto da "https://it.wikipedia.org/w/index.php?title=Pgrep&oldid=112661320"

  • Indonesia
  • English
  • Français
  • 日本語
  • Deutsch
  • Italiano
  • Español
  • Русский
  • فارسی
  • Polski
  • 中文
  • Nederlands
  • Português
  • العربية
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022