Table des matières
Dernière mise-à-jour : 2020/01/30 03:27
Gestion des Processus
Un processus est un fichier binaire ( binary file ) qui est chargé en mémoire centrale. Une fois chargé la mémoire exécute le programme en langage machine. Quand le programme est chargé, il a besoin du système d’exploitation qui lui fournit des informations pour qu’il puisse s’exécuter correctement. Ces informations sont appelées des données d’identification.
L’ensemble des données d’identification est appelé l’environnement de processus :
- Un numéro de processus unique (PID),
- Un numéro de processus parent (PPID),
- Un numéro d'utilisateur (UID),
- Un numéro de groupe (GID),
- La durée de traitement,
- La priorité du processus,
- Le répertoire de travail actif,
- Les fichiers ouverts.
Ces informations sont stockés dans le répertoire /proc. Le répertoire /proc contient des fichiers et des répertoires virtuels. Le contenu de ces fichiers est créé dynamiquement lors de la consultation. Seul root peut consulter la totalité des informations dans le répertoire /proc.
Saisissez la commande suivante :
root@ubuntu:/# cd /proc; ls -d [0-9]* 1 10924 10933 11269 12 13053 14 1756 1816 1858 1921 1960 2140 2228 2326 2473 2737 3960 42 646 711 873 10 10925 10934 11270 12200 13055 15 1762 1817 1862 1925 1985 2149 2234 2332 25 2785 3961 43 648 712 876 1037 10926 10935 114 12229 13083 1536 1784 1832 1884 1927 2 2150 2248 2340 252 2786 3962 44 651 715 881 10918 10927 10936 11447 1268 13084 16 1789 1837 1886 1929 20 2185 2295 2373 2547 28 3966 45 652 757 9 10919 10928 10937 11453 12731 1309 1654 1797 1838 1892 1933 2012 22 23 2380 258 29 4041 5 67 770 914 10920 10929 11 11463 129 13157 1656 18 1839 1894 1938 21 2205 2307 2399 2597 2983 4042 523 68 8 917 10921 10930 11051 116 13 13163 17 1803 1844 19 1942 2125 2208 2308 24 26 3 4043 591 7 827 964 10922 10931 1108 117 130 13179 1742 1811 1846 1906 1947 2133 2220 2316 2465 27 30 4044 610 701 835 989 10923 10932 11268 118 13047 1368 1751 1814 1850 1915 1959 2137 2224 2325 2472 2736 318 410 634 705 859
Chaque répertoire fait référence à un PID d'un processus. Les données de l’environnement de processus y sont présentes, par exemple :
root@ubuntu:/proc# cd 1 ; ls -l total 0 dr-xr-xr-x 2 root root 0 oct. 25 12:55 attr -rw-r--r-- 1 root root 0 oct. 25 12:55 autogroup -r-------- 1 root root 0 oct. 25 12:55 auxv -r--r--r-- 1 root root 0 oct. 14 15:27 cgroup --w------- 1 root root 0 oct. 25 12:55 clear_refs -r--r--r-- 1 root root 0 oct. 14 15:27 cmdline -rw-r--r-- 1 root root 0 oct. 25 12:55 comm -rw-r--r-- 1 root root 0 oct. 25 12:55 coredump_filter -r--r--r-- 1 root root 0 oct. 25 12:55 cpuset lrwxrwxrwx 1 root root 0 oct. 14 15:29 cwd -> / -r-------- 1 root root 0 oct. 14 15:27 environ lrwxrwxrwx 1 root root 0 oct. 14 15:27 exe -> /sbin/init dr-x------ 2 root root 0 oct. 14 15:29 fd dr-x------ 2 root root 0 oct. 25 12:55 fdinfo -rw-r--r-- 1 root root 0 oct. 25 12:55 gid_map -r-------- 1 root root 0 oct. 25 12:55 io -r--r--r-- 1 root root 0 oct. 25 12:55 latency -r--r--r-- 1 root root 0 oct. 14 15:27 limits -rw-r--r-- 1 root root 0 oct. 25 12:55 loginuid dr-x------ 2 root root 0 oct. 25 12:55 map_files -r--r--r-- 1 root root 0 oct. 14 15:29 maps -rw------- 1 root root 0 oct. 25 12:55 mem -r--r--r-- 1 root root 0 oct. 25 12:55 mountinfo -r--r--r-- 1 root root 0 oct. 25 12:55 mounts -r-------- 1 root root 0 oct. 25 12:55 mountstats dr-xr-xr-x 5 root root 0 oct. 25 12:55 net dr-x--x--x 2 root root 0 oct. 25 12:55 ns -rw-r--r-- 1 root root 0 oct. 25 12:55 oom_adj -r--r--r-- 1 root root 0 oct. 25 12:55 oom_score -rw-r--r-- 1 root root 0 oct. 25 12:55 oom_score_adj -r--r--r-- 1 root root 0 oct. 25 12:55 pagemap -r--r--r-- 1 root root 0 oct. 25 12:55 personality -rw-r--r-- 1 root root 0 oct. 25 12:55 projid_map lrwxrwxrwx 1 root root 0 oct. 14 15:27 root -> / -rw-r--r-- 1 root root 0 oct. 25 12:55 sched -r--r--r-- 1 root root 0 oct. 25 12:55 schedstat -r--r--r-- 1 root root 0 oct. 25 12:55 sessionid -r--r--r-- 1 root root 0 oct. 25 12:55 smaps -r--r--r-- 1 root root 0 oct. 25 12:55 stack -r--r--r-- 1 root root 0 oct. 14 15:27 stat -r--r--r-- 1 root root 0 oct. 25 12:55 statm -r--r--r-- 1 root root 0 oct. 14 15:27 status -r--r--r-- 1 root root 0 oct. 25 12:55 syscall dr-xr-xr-x 3 root root 0 oct. 25 12:55 task -r--r--r-- 1 root root 0 oct. 25 12:55 timers -rw-r--r-- 1 root root 0 oct. 25 12:55 uid_map -r--r--r-- 1 root root 0 oct. 25 12:55 wchan
Vous n'avez pas besoin de consulter le contenu des fichiers et des répertoires. Il convient tout simplement de savoir que ces données existent. Naviguez donc à /root en ligne de commande.
Les Types de Processus
Il existe trois types de processus :
- interactif qui est lancé par le shell dans une console en premier plan ou en tâche de fond
- batch qui est lancé par le système au moment propice
- daemon qui est lancé au démarrage par le système ( lpd, dns etc )
Un processus peut être dans un de neuf états ou process states :
- user mode - le processus s'exécute en mode utilisateur,
- kernel mode- le processus s'exécute en mode noyau,
- waiting – le processus est en attente pour une ressource autre que le processeur,
- sleeping - le processus est endormi,
- runnable – le processus dispose de toutes le ressources nécessaire à son exécution sauf le processeur,
- swap - le processus est endormi dans la mémoire virtuelle,
- new - le processus est nouveau,
- elected – le processus a le contrôle du processeur,
- zombie – le processus a terminé son exécution et est prêt à mourir.
Les Commandes relatives aux Processus
La commande ps
Cette commande affiche les processus de l’utilisateur attaché au terminal
root@ubuntu:/proc/1# cd ~ root@ubuntu:~# ps PID TTY TIME CMD 11268 pts/12 00:00:00 sudo 11269 pts/12 00:00:00 su 11270 pts/12 00:00:00 bash 13207 pts/12 00:00:00 ps
pour plus de détails, il convient d'utiliser l'option -l :
root@ubuntu:~# ps -l F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 4 S 0 11268 2473 0 80 0 - 1711 poll_s pts/12 00:00:00 sudo 4 S 0 11269 11268 0 80 0 - 1590 wait pts/12 00:00:00 su 4 S 0 11270 11269 0 80 0 - 1763 wait pts/12 00:00:00 bash 0 R 0 13211 11270 0 80 0 - 1249 - pts/12 00:00:00 ps
On note dans cette sortie :
F | Drapeaux du processus. La valeur 4 indique que le processus utilise les privilèges de root |
---|---|
S | État du processus S (sleeping), R (In run queue), Z (zombie), N (low priority), D (uninterruptible sleep), T (Traced) |
UID | Numéro de l’Utilisateur |
PID | Numéro Unique de Processus |
PPID | PID du processus parent |
C | Facteur de priorité du processus |
PRI | Priorité du processus |
NI | La valeur de nice |
ADDR | Adresse mémoire du processus |
SZ | Utilisation de la mémoire virtuelle |
WCHAN | Nom de la fonction du noyau dans laquelle le processus est endormi |
TTY | Nom du terminal depuis lequel le processus a été lancé |
TIME | Durée d'exécution du processus |
CMD | Commande exécutée |
Pour visualiser la table des processus, utilisez la commande ps avec les options l et x - la commande affiche tous les processus avec un affichage long :
root@ubuntu:~# ps lx F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 4 0 1 0 20 0 4576 2552 poll_s Ss ? 0:01 /sbin/init 1 0 2 0 20 0 0 0 kthrea S ? 0:00 [kthreadd] 1 0 3 2 20 0 0 0 smpboo S ? 0:00 [ksoftirqd/0] 1 0 5 2 0 -20 0 0 worker S< ? 0:00 [kworker/0:0H] 1 0 7 2 20 0 0 0 - R ? 0:02 [rcu_sched] 1 0 8 2 20 0 0 0 rcu_gp S ? 0:00 [rcu_bh] 1 0 9 2 -100 - 0 0 smpboo S ? 0:00 [migration/0] 5 0 10 2 -100 - 0 0 smpboo S ? 0:01 [watchdog/0] 1 0 11 2 0 -20 0 0 rescue S< ? 0:00 [khelper] 5 0 12 2 20 0 0 0 devtmp S ? 0:00 [kdevtmpfs] 1 0 13 2 0 -20 0 0 rescue S< ? 0:00 [netns] 1 0 14 2 0 -20 0 0 rescue S< ? 0:00 [writeback] 1 0 15 2 0 -20 0 0 rescue S< ? 0:00 [kintegrityd] 1 0 16 2 0 -20 0 0 rescue S< ? 0:00 [bioset] 1 0 17 2 0 -20 0 0 worker S< ? 0:00 [kworker/u3:0] 1 0 18 2 0 -20 0 0 rescue S< ? 0:00 [kblockd] 1 0 19 2 0 -20 0 0 rescue S< ? 0:00 [ata_sff] 1 0 20 2 20 0 0 0 hub_th S ? 0:00 [khubd] 1 0 21 2 0 -20 0 0 rescue S< ? 0:00 [md] 1 0 22 2 0 -20 0 0 rescue S< ? 0:00 [devfreq_wq] 1 0 23 2 20 0 0 0 - R ? 0:26 [kworker/0:1] 1 0 24 2 20 0 0 0 watchd S ? 0:00 [khungtaskd] 1 0 25 2 20 0 0 0 kswapd S ? 0:00 [kswapd0] 1 0 26 2 25 5 0 0 ksm_sc SN ? 0:00 [ksmd] 1 0 27 2 39 19 0 0 khugep SN ? 0:00 [khugepaged] 1 0 28 2 20 0 0 0 fsnoti S ? 0:00 [fsnotify_mark] 1 0 29 2 20 0 0 0 ecrypt S ? 0:00 [ecryptfs-kthrea] 1 0 30 2 0 -20 0 0 rescue S< ? 0:00 [crypto] 1 0 42 2 0 -20 0 0 rescue S< ? 0:00 [kthrotld] 1 0 43 2 20 0 0 0 worker S ? 0:01 [kworker/u2:1] 1 0 44 2 20 0 0 0 scsi_e S ? 0:00 [scsi_eh_0] 1 0 45 2 20 0 0 0 scsi_e S ? 0:00 [scsi_eh_1] 1 0 67 2 0 -20 0 0 rescue S< ? 0:00 [deferwq] 1 0 68 2 0 -20 0 0 rescue S< ? 0:00 [charger_manager] 1 0 114 2 0 -20 0 0 rescue S< ? 0:00 [kpsmoused] 1 0 116 2 0 -20 0 0 worker S< ? 0:00 [kworker/u3:1] 1 0 117 2 20 0 0 0 scsi_e S ? 0:00 [scsi_eh_2] 1 0 118 2 20 0 0 0 scsi_e S ? 0:00 [scsi_eh_3] 1 0 129 2 20 0 0 0 kjourn S ? 0:00 [jbd2/sda1-8] 1 0 130 2 0 -20 0 0 rescue S< ? 0:00 [ext4-rsv-conver] 1 0 252 1 20 0 3012 612 poll_s S ? 0:00 upstart-udev-bridge --daemon 5 0 258 1 20 0 12272 1624 ep_pol Ss ? 0:00 /lib/systemd/systemd-udevd --daemon 1 0 318 2 0 -20 0 0 rescue S< ? 0:00 [iprt] 1 0 410 1 20 0 2872 600 poll_s S ? 0:00 upstart-socket-bridge --daemon 1 0 591 1 20 0 2884 596 poll_s S ? 0:00 upstart-file-bridge --daemon 5 0 634 1 20 0 4880 1648 poll_s Ss ? 0:00 /usr/sbin/bluetoothd 4 0 646 1 20 0 4296 1828 ep_pol Ss ? 0:00 /lib/systemd/systemd-logind 5 0 648 2 10 -10 0 0 rfcomm S< ? 0:00 [krfcommd] 4 0 701 1 20 0 4648 844 n_tty_ Ss+ tty4 0:00 /sbin/getty -8 38400 tty4 4 0 705 1 20 0 4648 860 n_tty_ Ss+ tty5 0:00 /sbin/getty -8 38400 tty5 4 0 711 1 20 0 4648 860 n_tty_ Ss+ tty2 0:00 /sbin/getty -8 38400 tty2 4 0 712 1 20 0 4648 852 n_tty_ Ss+ tty3 0:00 /sbin/getty -8 38400 tty3 4 0 715 1 20 0 4648 856 n_tty_ Ss+ tty6 0:00 /sbin/getty -8 38400 tty6 1 0 757 1 20 0 2196 628 poll_s Ss ? 0:00 acpid -c /etc/acpi/events -s /var/run/acpid.socket 4 0 827 1 20 0 35792 6104 poll_s SLsl ? 0:00 lightdm 4 0 835 1 20 0 8852 2900 poll_s Ss ? 0:00 /usr/sbin/cups-browsed 5 0 859 1 20 0 3056 912 hrtime Ss ? 0:00 cron 4 0 873 1 20 0 36812 7324 poll_s Sl ? 0:00 /usr/lib/policykit-1/polkitd --no-debug 4 0 876 827 20 0 152676 53292 poll_s Ss+ tty7 7:08 /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tc 4 0 881 1 20 0 36988 6456 poll_s Sl ? 0:00 /usr/lib/accountsservice/accounts-daemon 4 0 914 1 20 0 2268 552 wait Ss ? 0:00 /bin/sh -e /proc/self/fd/9 0 0 917 914 20 0 3584 1464 poll_s S ? 0:00 initctl emit plymouth-ready 1 0 989 1 20 0 9796 1016 sigtim Sl ? 0:25 /usr/sbin/VBoxService 4 0 1037 1 20 0 4648 856 n_tty_ Ss+ tty1 0:00 /sbin/getty -8 38400 tty1 1 0 1108 2 20 0 0 0 kaudit S ? 0:00 [kauditd] 4 0 1268 827 20 0 17824 3520 wait Sl ? 0:00 lightdm --session-child 12 19 4 0 1309 1 20 0 37792 4112 poll_s Sl ? 0:00 /usr/lib/upower/upowerd 4 0 2208 1 20 0 53264 5336 poll_s Sl ? 0:00 /usr/lib/udisks2/udisksd --no-debug 1 0 2736 2 20 0 0 0 kjourn S ? 0:00 [jbd2/sda11-8] 1 0 2737 2 0 -20 0 0 rescue S< ? 0:00 [ext4-rsv-conver] 1 0 2785 2 20 0 0 0 kjourn S ? 0:00 [jbd2/sda12] 1 0 2786 2 0 -20 0 0 rescue S< ? 0:00 [ext4-rsv-conver] 4 0 2983 1 20 0 8156 2884 ep_pol Ss ? 0:00 /usr/sbin/cupsd -f 1 0 3960 2 0 -20 0 0 rescue S< ? 0:00 [xfsalloc] 1 0 3961 2 0 -20 0 0 rescue S< ? 0:00 [xfs_mru_cache] 1 0 3962 2 0 -20 0 0 rescue S< ? 0:00 [xfslogd] 1 0 3966 2 0 -20 0 0 worker S< ? 0:00 [kworker/0:1H] 1 0 4041 2 0 -20 0 0 rescue S< ? 0:00 [xfs-data/sda10] 1 0 4042 2 0 -20 0 0 rescue S< ? 0:00 [xfs-conv/sda10] 1 0 4043 2 0 -20 0 0 rescue S< ? 0:00 [xfs-cil/sda10] 1 0 4044 2 20 0 0 0 xfsail S ? 0:00 [xfsaild/sda10] 1 0 10918 2 0 -20 0 0 rescue S< ? 0:00 [bioset] 1 0 10919 2 20 0 0 0 worker S ? 0:00 [btrfs-worker-1] 1 0 10920 2 20 0 0 0 worker S ? 0:00 [btrfs-genwork-1] 1 0 10921 2 20 0 0 0 worker S ? 0:00 [btrfs-submit-1] 1 0 10922 2 20 0 0 0 worker S ? 0:00 [btrfs-delalloc-] 1 0 10923 2 20 0 0 0 worker S ? 0:00 [btrfs-fixup-1] 1 0 10924 2 20 0 0 0 worker S ? 0:00 [btrfs-endio-1] 1 0 10925 2 20 0 0 0 worker S ? 0:00 [btrfs-endio-met] 1 0 10926 2 20 0 0 0 worker S ? 0:00 [btrfs-rmw-1] 1 0 10927 2 20 0 0 0 worker S ? 0:00 [btrfs-endio-rai] 1 0 10928 2 20 0 0 0 worker S ? 0:00 [btrfs-endio-met] 1 0 10929 2 20 0 0 0 worker S ? 0:00 [btrfs-endio-wri] 1 0 10930 2 20 0 0 0 worker S ? 0:00 [btrfs-freespace] 1 0 10931 2 20 0 0 0 worker S ? 0:00 [btrfs-delayed-m] 1 0 10932 2 20 0 0 0 worker S ? 0:00 [btrfs-cache-1] 1 0 10933 2 20 0 0 0 worker S ? 0:00 [btrfs-readahead] 1 0 10934 2 20 0 0 0 worker S ? 0:00 [btrfs-flush_del] 1 0 10935 2 20 0 0 0 worker S ? 0:00 [btrfs-qgroup-re] 1 0 10936 2 20 0 0 0 cleane S ? 0:00 [btrfs-cleaner] 1 0 10937 2 20 0 0 0 transa S ? 0:00 [btrfs-transacti] 1 0 11051 2 20 0 0 0 worker S ? 0:03 [kworker/u2:2] 4 0 11268 2473 20 0 6844 2112 poll_s S pts/12 0:00 sudo su - 4 0 11269 11268 20 0 6360 1640 wait S pts/12 0:00 su - 4 0 11270 11269 20 0 7052 3408 wait S pts/12 0:00 -su 4 0 11447 1 20 0 37380 5880 poll_s Ssl ? 0:00 /usr/sbin/ModemManager 5 0 11453 1 20 0 53736 6400 poll_s Ssl ? 0:00 NetworkManager 1 0 12731 2 20 0 0 0 worker S ? 0:00 [kworker/0:2] 1 0 13047 2 20 0 0 0 worker S ? 0:00 [kworker/0:0] 4 0 13084 11453 20 0 5516 3092 poll_s S ? 0:00 /sbin/dhclient -d -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /ru 0 0 13212 11270 20 0 4996 780 - R+ pts/12 0:00 ps -lx
On note dans cette sortie certaines informations supplémentaires :
VSZ | La même chose que SZ dans l'exemple ci-dessus |
---|---|
RSS | La mémoire utilisée en kilobytes par le processus |
STAT | La même chose que S dans l'exemple ci-dessus |
Avec des options a,u et x la commande affiche le résultat suivant :
root@ubuntu:~# ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 4576 2552 ? Ss oct.24 0:01 /sbin/init root 2 0.0 0.0 0 0 ? S oct.24 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S oct.24 0:00 [ksoftirqd/0] root 5 0.0 0.0 0 0 ? S< oct.24 0:00 [kworker/0:0H] root 7 0.0 0.0 0 0 ? S oct.24 0:02 [rcu_sched] root 8 0.0 0.0 0 0 ? S oct.24 0:00 [rcu_bh] root 9 0.0 0.0 0 0 ? S oct.24 0:00 [migration/0] root 10 0.0 0.0 0 0 ? S oct.24 0:01 [watchdog/0] root 11 0.0 0.0 0 0 ? S< oct.24 0:00 [khelper] root 12 0.0 0.0 0 0 ? S oct.24 0:00 [kdevtmpfs] root 13 0.0 0.0 0 0 ? S< oct.24 0:00 [netns] root 14 0.0 0.0 0 0 ? S< oct.24 0:00 [writeback] root 15 0.0 0.0 0 0 ? S< oct.24 0:00 [kintegrityd] root 16 0.0 0.0 0 0 ? S< oct.24 0:00 [bioset] root 17 0.0 0.0 0 0 ? S< oct.24 0:00 [kworker/u3:0] root 18 0.0 0.0 0 0 ? S< oct.24 0:00 [kblockd] root 19 0.0 0.0 0 0 ? S< oct.24 0:00 [ata_sff] root 20 0.0 0.0 0 0 ? S oct.24 0:00 [khubd] root 21 0.0 0.0 0 0 ? S< oct.24 0:00 [md] root 22 0.0 0.0 0 0 ? S< oct.24 0:00 [devfreq_wq] root 23 0.0 0.0 0 0 ? S oct.24 0:26 [kworker/0:1] root 24 0.0 0.0 0 0 ? S oct.24 0:00 [khungtaskd] root 25 0.0 0.0 0 0 ? S oct.24 0:00 [kswapd0] root 26 0.0 0.0 0 0 ? SN oct.24 0:00 [ksmd] root 27 0.0 0.0 0 0 ? SN oct.24 0:00 [khugepaged] root 28 0.0 0.0 0 0 ? S oct.24 0:00 [fsnotify_mark] root 29 0.0 0.0 0 0 ? S oct.24 0:00 [ecryptfs-kthrea] root 30 0.0 0.0 0 0 ? S< oct.24 0:00 [crypto] root 42 0.0 0.0 0 0 ? S< oct.24 0:00 [kthrotld] root 43 0.0 0.0 0 0 ? S oct.24 0:01 [kworker/u2:1] root 44 0.0 0.0 0 0 ? S oct.24 0:00 [scsi_eh_0] root 45 0.0 0.0 0 0 ? S oct.24 0:00 [scsi_eh_1] root 67 0.0 0.0 0 0 ? S< oct.24 0:00 [deferwq] root 68 0.0 0.0 0 0 ? S< oct.24 0:00 [charger_manager] root 114 0.0 0.0 0 0 ? S< oct.24 0:00 [kpsmoused] root 116 0.0 0.0 0 0 ? S< oct.24 0:00 [kworker/u3:1] root 117 0.0 0.0 0 0 ? S oct.24 0:00 [scsi_eh_2] root 118 0.0 0.0 0 0 ? S oct.24 0:00 [scsi_eh_3] root 129 0.0 0.0 0 0 ? S oct.24 0:00 [jbd2/sda1-8] root 130 0.0 0.0 0 0 ? S< oct.24 0:00 [ext4-rsv-conver] root 252 0.0 0.0 3012 612 ? S oct.24 0:00 upstart-udev-bridge --daemon root 258 0.0 0.0 12272 1624 ? Ss oct.24 0:00 /lib/systemd/systemd-udevd --daemon root 318 0.0 0.0 0 0 ? S< oct.24 0:00 [iprt] root 410 0.0 0.0 2872 600 ? S oct.24 0:00 upstart-socket-bridge --daemon message+ 523 0.0 0.1 5136 2276 ? Ss oct.24 0:06 dbus-daemon --system --fork root 591 0.0 0.0 2884 596 ? S oct.24 0:00 upstart-file-bridge --daemon syslog 610 0.0 0.0 30608 1584 ? Ssl oct.24 0:00 rsyslogd root 634 0.0 0.0 4880 1648 ? Ss oct.24 0:00 /usr/sbin/bluetoothd root 646 0.0 0.0 4296 1828 ? Ss oct.24 0:00 /lib/systemd/systemd-logind root 648 0.0 0.0 0 0 ? S< oct.24 0:00 [krfcommd] avahi 651 0.0 0.0 3476 1380 ? S oct.24 0:00 avahi-daemon: running [ubuntu.local] avahi 652 0.0 0.0 3476 432 ? S oct.24 0:00 avahi-daemon: chroot helper root 701 0.0 0.0 4648 844 tty4 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty4 root 705 0.0 0.0 4648 860 tty5 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty5 root 711 0.0 0.0 4648 860 tty2 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty2 root 712 0.0 0.0 4648 852 tty3 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty3 root 715 0.0 0.0 4648 856 tty6 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty6 root 757 0.0 0.0 2196 628 ? Ss oct.24 0:00 acpid -c /etc/acpi/events -s /var/run/acpid.socket kernoops 770 0.0 0.0 6388 956 ? Ss oct.24 0:00 /usr/sbin/kerneloops root 827 0.0 0.3 35792 6104 ? SLsl oct.24 0:00 lightdm root 835 0.0 0.1 8852 2900 ? Ss oct.24 0:00 /usr/sbin/cups-browsed root 859 0.0 0.0 3056 912 ? Ss oct.24 0:00 cron root 873 0.0 0.3 36812 7324 ? Sl oct.24 0:00 /usr/lib/policykit-1/polkitd --no-debug root 876 0.7 2.6 152676 53292 tty7 Ss+ oct.24 7:09 /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp v root 881 0.0 0.3 36988 6456 ? Sl oct.24 0:00 /usr/lib/accountsservice/accounts-daemon root 914 0.0 0.0 2268 552 ? Ss oct.24 0:00 /bin/sh -e /proc/self/fd/9 root 917 0.0 0.0 3584 1464 ? S oct.24 0:00 initctl emit plymouth-ready whoopsie 964 0.0 0.2 61204 4892 ? Ssl oct.24 0:00 whoopsie root 989 0.0 0.0 9796 1016 ? Sl oct.24 0:25 /usr/sbin/VBoxService root 1037 0.0 0.0 4648 856 tty1 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty1 root 1108 0.0 0.0 0 0 ? S oct.24 0:00 [kauditd] root 1268 0.0 0.1 17824 3520 ? Sl oct.24 0:00 lightdm --session-child 12 19 root 1309 0.0 0.2 37792 4112 ? Sl oct.24 0:00 /usr/lib/upower/upowerd rtkit 1368 0.0 0.0 21364 1220 ? SNl oct.24 0:01 /usr/lib/rtkit/rtkit-daemon colord 1536 0.0 0.2 37672 5732 ? Sl oct.24 0:00 /usr/lib/colord/colord trainee 1654 0.0 0.2 65140 4712 ? Sl oct.24 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login trainee 1656 0.0 0.1 6848 2748 ? Ss oct.24 0:00 init --user trainee 1742 0.0 0.0 9268 1676 ? Sl oct.24 0:00 /usr/bin/VBoxClient --clipboard trainee 1751 0.0 0.0 9396 1772 ? Sl oct.24 0:00 /usr/bin/VBoxClient --display trainee 1756 0.0 0.0 8232 1192 ? Sl oct.24 0:00 /usr/bin/VBoxClient --seamless trainee 1762 0.0 0.0 9916 1436 ? Sl oct.24 0:00 /usr/bin/VBoxClient --draganddrop trainee 1784 0.0 0.0 4212 200 ? Ss oct.24 0:00 ssh-agent -s trainee 1789 0.0 0.1 6136 2600 ? Ss oct.24 0:01 dbus-daemon --fork --session --address=unix:abstract=/tmp/dbus-kj5dJMP6Nz trainee 1797 0.0 0.0 4952 1048 ? Ss oct.24 0:00 upstart-event-bridge trainee 1803 0.0 0.1 39460 3708 ? Ss oct.24 0:00 /usr/lib/i386-linux-gnu/hud/window-stack-bridge trainee 1811 0.0 0.0 4956 600 ? S oct.24 0:00 upstart-dbus-bridge --daemon --system --user --bus-name system trainee 1814 0.0 0.0 5388 916 ? S oct.24 0:00 upstart-file-bridge --daemon --user trainee 1816 0.0 0.0 5020 768 ? S oct.24 0:00 upstart-dbus-bridge --daemon --session --user --bus-name session trainee 1817 0.0 0.2 47160 4756 ? Ssl oct.24 0:11 /usr/bin/ibus-daemon --daemonize --xim trainee 1832 0.0 0.8 165072 16636 ? Ssl oct.24 0:02 /usr/lib/unity-settings-daemon/unity-settings-daemon trainee 1837 0.0 0.9 115088 20132 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/hud/hud-service trainee 1838 0.0 0.3 45296 6184 ? Ssl oct.24 0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher --launch-immediately trainee 1839 0.0 0.7 88596 15036 ? Ssl oct.24 0:00 gnome-session --session=ubuntu trainee 1844 0.0 0.9 118512 20068 ? Ssl oct.24 0:03 /usr/lib/unity/unity-panel-service trainee 1846 0.0 0.0 4496 1900 ? S oct.24 0:00 /bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --prin trainee 1850 0.0 0.1 17364 3096 ? Sl oct.24 0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session trainee 1858 0.0 0.1 52532 3192 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfsd trainee 1862 0.0 0.2 44088 5504 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes trainee 1884 0.0 0.1 38164 4028 ? Sl oct.24 0:00 /usr/lib/ibus/ibus-dconf trainee 1886 0.0 0.6 117344 13984 ? Sl oct.24 0:02 /usr/lib/ibus/ibus-ui-gtk3 trainee 1892 0.0 0.5 51320 11612 ? Sl oct.24 0:00 /usr/lib/ibus/ibus-x11 --kill-daemon trainee 1894 0.0 0.5 122676 11792 ? Sl oct.24 0:01 /usr/lib/i386-linux-gnu/bamf/bamfdaemon trainee 1906 0.0 0.1 29884 3892 ? Sl oct.24 0:03 /usr/lib/ibus/ibus-engine-simple trainee 1915 0.0 0.1 24512 2464 ? Sl oct.24 0:00 /usr/lib/dconf/dconf-service trainee 1921 0.0 0.7 142888 15764 ? Sl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-keyboard-service --use-gtk trainee 1925 0.0 0.1 46252 3696 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-messages/indicator-messages-service trainee 1927 0.0 0.1 38176 3788 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-bluetooth/indicator-bluetooth-service trainee 1929 0.0 0.2 38112 4064 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-power/indicator-power-service trainee 1933 0.0 0.6 100572 12396 ? Ssl oct.24 0:01 /usr/lib/i386-linux-gnu/indicator-datetime/indicator-datetime-service trainee 1938 0.0 0.2 117896 5732 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-sound/indicator-sound-service trainee 1942 0.0 0.5 57240 10572 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-printers/indicator-printers-service trainee 1947 0.0 0.2 100412 5492 ? S<l oct.24 0:00 /usr/bin/pulseaudio --start --log-target=syslog trainee 1959 0.0 0.2 63036 4388 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-session/indicator-session-service trainee 1960 0.0 0.2 46572 4320 ? Ssl oct.24 0:00 /usr/lib/i386-linux-gnu/indicator-application/indicator-application-service trainee 1985 0.0 0.5 89744 11604 ? Sl oct.24 0:00 /usr/lib/evolution/evolution-source-registry trainee 2012 0.0 0.8 111472 17532 ? Sl oct.24 0:01 /usr/lib/i386-linux-gnu/notify-osd trainee 2125 9.8 9.1 434316 185152 ? Sl oct.24 98:05 compiz trainee 2133 0.0 1.5 129340 31564 ? Sl oct.24 0:00 /usr/lib/evolution/evolution-calendar-factory trainee 2137 0.0 0.5 44928 11244 ? Sl oct.24 0:00 /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 trainee 2140 0.0 1.5 224188 31060 ? Sl oct.24 0:15 nautilus -n trainee 2149 0.0 0.8 190792 16748 ? Sl oct.24 0:00 nm-applet trainee 2150 0.0 0.6 53008 13220 ? Sl oct.24 0:00 /usr/lib/unity-settings-daemon/unity-fallback-mount-helper trainee 2185 0.0 0.2 47888 5528 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor trainee 2205 0.0 0.1 9952 3112 ? S oct.24 0:00 /usr/lib/i386-linux-gnu/gconf/gconfd-2 root 2208 0.0 0.2 53264 5336 ? Sl oct.24 0:00 /usr/lib/udisks2/udisksd --no-debug trainee 2220 0.0 0.2 28468 5048 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor trainee 2224 0.0 0.1 27356 2796 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor trainee 2228 0.0 0.2 38532 4968 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor trainee 2234 0.0 0.3 36140 6848 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfsd-burn --spawner :1.6 /org/gtk/gvfs/exec_spaw/0 trainee 2248 0.0 0.2 63568 4300 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.6 /org/gtk/gvfs/exec_spaw/1 trainee 2295 0.0 0.7 100836 15180 ? Sl oct.24 0:00 /usr/lib/i386-linux-gnu/unity-scope-home/unity-scope-home trainee 2307 0.0 1.1 105492 22392 ? Sl oct.24 0:02 /usr/bin/unity-scope-loader applications/applications.scope applications/scope trainee 2308 0.0 0.4 92756 9572 ? Sl oct.24 0:00 /usr/lib/i386-linux-gnu/unity-lens-files/unity-files-daemon trainee 2316 0.0 0.2 45216 5052 ? Sl oct.24 0:00 /usr/bin/zeitgeist-daemon trainee 2325 0.0 0.6 66632 12820 ? Sl oct.24 0:01 /usr/lib/i386-linux-gnu/zeitgeist-fts trainee 2326 0.0 0.3 68660 6356 ? Sl oct.24 0:01 zeitgeist-datahub trainee 2332 0.0 0.0 4248 280 ? S oct.24 0:00 /bin/cat trainee 2340 0.0 0.5 67912 10316 ? Sl oct.24 0:01 /usr/lib/i386-linux-gnu/unity-lens-music/unity-music-daemon trainee 2373 0.0 0.7 83088 14812 ? Sl oct.24 0:00 telepathy-indicator trainee 2380 0.0 0.4 44580 9236 ? Sl oct.24 0:00 /usr/lib/telepathy/mission-control-5 trainee 2399 0.0 0.7 82060 14704 ? Sl oct.24 0:00 /usr/lib/gvfs/gvfsd-http --spawner :1.6 /org/gtk/gvfs/exec_spaw/2 trainee 2465 0.0 1.0 137812 20636 ? Sl oct.24 0:53 gnome-terminal trainee 2472 0.0 0.0 2420 740 ? S oct.24 0:00 gnome-pty-helper trainee 2473 0.0 0.1 7028 3276 pts/12 Ss oct.24 0:00 bash trainee 2547 0.0 0.8 71764 16836 ? Sl oct.24 0:00 update-notifier trainee 2597 0.0 0.2 64376 4816 ? Sl oct.24 0:00 /usr/lib/i386-linux-gnu/deja-dup/deja-dup-monitor root 2736 0.0 0.0 0 0 ? S oct.24 0:00 [jbd2/sda11-8] root 2737 0.0 0.0 0 0 ? S< oct.24 0:00 [ext4-rsv-conver] root 2785 0.0 0.0 0 0 ? S oct.24 0:00 [jbd2/sda12] root 2786 0.0 0.0 0 0 ? S< oct.24 0:00 [ext4-rsv-conver] root 2983 0.0 0.1 8156 2884 ? Ss oct.24 0:00 /usr/sbin/cupsd -f root 3960 0.0 0.0 0 0 ? S< oct.24 0:00 [xfsalloc] root 3961 0.0 0.0 0 0 ? S< oct.24 0:00 [xfs_mru_cache] root 3962 0.0 0.0 0 0 ? S< oct.24 0:00 [xfslogd] root 3966 0.0 0.0 0 0 ? S< oct.24 0:00 [kworker/0:1H] root 4041 0.0 0.0 0 0 ? S< oct.24 0:00 [xfs-data/sda10] root 4042 0.0 0.0 0 0 ? S< oct.24 0:00 [xfs-conv/sda10] root 4043 0.0 0.0 0 0 ? S< oct.24 0:00 [xfs-cil/sda10] root 4044 0.0 0.0 0 0 ? S oct.24 0:00 [xfsaild/sda10] root 10918 0.0 0.0 0 0 ? S< 03:55 0:00 [bioset] root 10919 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-worker-1] root 10920 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-genwork-1] root 10921 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-submit-1] root 10922 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-delalloc-] root 10923 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-fixup-1] root 10924 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-endio-1] root 10925 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-endio-met] root 10926 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-rmw-1] root 10927 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-endio-rai] root 10928 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-endio-met] root 10929 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-endio-wri] root 10930 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-freespace] root 10931 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-delayed-m] root 10932 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-cache-1] root 10933 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-readahead] root 10934 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-flush_del] root 10935 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-qgroup-re] root 10936 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-cleaner] root 10937 0.0 0.0 0 0 ? S 03:55 0:00 [btrfs-transacti] root 11051 0.0 0.0 0 0 ? S 06:10 0:03 [kworker/u2:2] root 11268 0.0 0.1 6844 2112 pts/12 S 10:24 0:00 sudo su - root 11269 0.0 0.0 6360 1640 pts/12 S 10:24 0:00 su - root 11270 0.0 0.1 7052 3408 pts/12 S 10:24 0:00 -su root 11447 0.0 0.2 37380 5880 ? Ssl 10:43 0:00 /usr/sbin/ModemManager root 11453 0.0 0.3 53736 6400 ? Ssl 10:43 0:00 NetworkManager nobody 11463 0.0 0.0 5612 1500 ? S 10:43 0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces daemon 12200 0.0 0.0 2644 124 ? Ss 10:43 0:00 atd trainee 12229 0.0 3.1 198876 62960 ? SNl 10:44 0:04 /usr/bin/python3 /usr/bin/update-manager --no-update --no-focus-on-map root 12731 0.0 0.0 0 0 ? S 12:13 0:00 [kworker/0:2] root 13047 0.0 0.0 0 0 ? S 12:54 0:00 [kworker/0:0] root 13084 0.0 0.1 5516 3092 ? S 12:54 0:00 /sbin/dhclient -d -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /run/se root 13216 0.0 0.0 5232 1164 pts/12 R+ 12:57 0:00 ps aux
On note dans cette sortie certaines informations supplémentaires :
USER | L'utilisateur du processus |
---|---|
%CPU | Ressources du microprocesseur utilisées par le processus |
%MEM | Ressources en mémoire vive utilisées par le processus |
Options de la commande ps
Les options de cette commande sont :
root@ubuntu:~# ps --help all Utilisation : ps [options] Basic options: -A, -e all processes -a all with tty, except session leaders a all with tty, including other users -d all except session leaders -N, --deselect negate selection r only running processes T all processes on this terminal x processes without controlling ttys Selection by list: -C <command> command name -G, --Group <gid> real group id or name -g, --group <group> session or effective group name -p, --pid <pid> process id --ppid <pid> select by parent process id -s, --sid <session> session id -t, t, --tty <tty> terminal -u, U, --user <uid> effective user id or name -U, --User <uid> real user id or name selection <arguments> take either: comma-separated list e.g. '-u root,nobody' or blank-separated list e.g. '-p 123 4567' Output formats: -F extra full -f full-format, including command lines f, --forest ascii art process tree -H show process hierarchy -j jobs format j BSD job control format -l long format l BSD long format -M, Z add security data (for SELinux) -O <format> preloaded with default columns O <format> as -O, with BSD personality -o, o, --format <format> user defined format s signal format u user-oriented format v virtual memory format X register format -y do not show flags, show rrs vs. addr (used with -l) --context display security context (for SELinux) --headers repeat header lines, one per page --no-headers do not print header at all --cols, --columns, --width <num> set screen width --rows, --lines <num> set screen height Show threads: H as if they where processes -L possibly with LWP and NLWP columns -m, m after processes -T possibly with SPID column Miscellaneous options: -c show scheduling class with -l option c show true command name e show the environment after command k, --sort specify sort order as: [+|-]key[,[+|-]key[,...]] L list format specifiers n display numeric uid and wchan S, --cumulative include some dead child process data -y do not show flags, show rss (only with -l) -V, V, --version display version information and exit -w, w unlimited output width --help <simple|list|output|threads|misc|all> display help and exit For more details see ps(1).
Notez l'option –forest :
root@ubuntu:~# ps aux --forest USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 2 0.0 0.0 0 0 ? S oct.24 0:00 [kthreadd] root 3 0.0 0.0 0 0 ? S oct.24 0:00 \_ [ksoftirqd/0] root 5 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kworker/0:0H] root 7 0.0 0.0 0 0 ? S oct.24 0:02 \_ [rcu_sched] root 8 0.0 0.0 0 0 ? S oct.24 0:00 \_ [rcu_bh] root 9 0.0 0.0 0 0 ? S oct.24 0:00 \_ [migration/0] root 10 0.0 0.0 0 0 ? S oct.24 0:01 \_ [watchdog/0] root 11 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [khelper] root 12 0.0 0.0 0 0 ? S oct.24 0:00 \_ [kdevtmpfs] root 13 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [netns] root 14 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [writeback] root 15 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kintegrityd] root 16 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [bioset] root 17 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kworker/u3:0] root 18 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kblockd] root 19 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [ata_sff] root 20 0.0 0.0 0 0 ? S oct.24 0:00 \_ [khubd] root 21 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [md] root 22 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [devfreq_wq] root 23 0.0 0.0 0 0 ? S oct.24 0:26 \_ [kworker/0:1] root 24 0.0 0.0 0 0 ? S oct.24 0:00 \_ [khungtaskd] root 25 0.0 0.0 0 0 ? S oct.24 0:00 \_ [kswapd0] root 26 0.0 0.0 0 0 ? SN oct.24 0:00 \_ [ksmd] root 27 0.0 0.0 0 0 ? SN oct.24 0:00 \_ [khugepaged] root 28 0.0 0.0 0 0 ? S oct.24 0:00 \_ [fsnotify_mark] root 29 0.0 0.0 0 0 ? S oct.24 0:00 \_ [ecryptfs-kthrea] root 30 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [crypto] root 42 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kthrotld] root 43 0.0 0.0 0 0 ? S oct.24 0:01 \_ [kworker/u2:1] root 44 0.0 0.0 0 0 ? S oct.24 0:00 \_ [scsi_eh_0] root 45 0.0 0.0 0 0 ? S oct.24 0:00 \_ [scsi_eh_1] root 67 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [deferwq] root 68 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [charger_manager] root 114 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kpsmoused] root 116 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kworker/u3:1] root 117 0.0 0.0 0 0 ? S oct.24 0:00 \_ [scsi_eh_2] root 118 0.0 0.0 0 0 ? S oct.24 0:00 \_ [scsi_eh_3] root 129 0.0 0.0 0 0 ? S oct.24 0:00 \_ [jbd2/sda1-8] root 130 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [ext4-rsv-conver] root 318 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [iprt] root 648 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [krfcommd] root 1108 0.0 0.0 0 0 ? S oct.24 0:00 \_ [kauditd] root 2736 0.0 0.0 0 0 ? S oct.24 0:00 \_ [jbd2/sda11-8] root 2737 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [ext4-rsv-conver] root 2785 0.0 0.0 0 0 ? S oct.24 0:00 \_ [jbd2/sda12] root 2786 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [ext4-rsv-conver] root 3960 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [xfsalloc] root 3961 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [xfs_mru_cache] root 3962 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [xfslogd] root 3966 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [kworker/0:1H] root 4041 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [xfs-data/sda10] root 4042 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [xfs-conv/sda10] root 4043 0.0 0.0 0 0 ? S< oct.24 0:00 \_ [xfs-cil/sda10] root 4044 0.0 0.0 0 0 ? S oct.24 0:00 \_ [xfsaild/sda10] root 10918 0.0 0.0 0 0 ? S< 03:55 0:00 \_ [bioset] root 10919 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-worker-1] root 10920 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-genwork-1] root 10921 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-submit-1] root 10922 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-delalloc-] root 10923 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-fixup-1] root 10924 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-endio-1] root 10925 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-endio-met] root 10926 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-rmw-1] root 10927 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-endio-rai] root 10928 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-endio-met] root 10929 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-endio-wri] root 10930 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-freespace] root 10931 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-delayed-m] root 10932 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-cache-1] root 10933 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-readahead] root 10934 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-flush_del] root 10935 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-qgroup-re] root 10936 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-cleaner] root 10937 0.0 0.0 0 0 ? S 03:55 0:00 \_ [btrfs-transacti] root 11051 0.0 0.0 0 0 ? S 06:10 0:03 \_ [kworker/u2:2] root 13047 0.0 0.0 0 0 ? S 12:54 0:00 \_ [kworker/0:0] root 1 0.0 0.1 4576 2552 ? Ss oct.24 0:01 /sbin/init root 252 0.0 0.0 3012 612 ? S oct.24 0:00 upstart-udev-bridge --daemon root 258 0.0 0.0 12272 1624 ? Ss oct.24 0:00 /lib/systemd/systemd-udevd --daemon root 410 0.0 0.0 2872 600 ? S oct.24 0:00 upstart-socket-bridge --daemon message+ 523 0.0 0.1 5136 2276 ? Ss oct.24 0:06 dbus-daemon --system --fork root 591 0.0 0.0 2884 596 ? S oct.24 0:00 upstart-file-bridge --daemon syslog 610 0.0 0.0 30608 1584 ? Ssl oct.24 0:00 rsyslogd root 634 0.0 0.0 4880 1648 ? Ss oct.24 0:00 /usr/sbin/bluetoothd root 646 0.0 0.0 4296 1828 ? Ss oct.24 0:00 /lib/systemd/systemd-logind avahi 651 0.0 0.0 3476 1380 ? S oct.24 0:00 avahi-daemon: running [ubuntu.local] avahi 652 0.0 0.0 3476 432 ? S oct.24 0:00 \_ avahi-daemon: chroot helper root 701 0.0 0.0 4648 844 tty4 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty4 root 705 0.0 0.0 4648 860 tty5 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty5 root 711 0.0 0.0 4648 860 tty2 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty2 root 712 0.0 0.0 4648 852 tty3 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty3 root 715 0.0 0.0 4648 856 tty6 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty6 root 757 0.0 0.0 2196 628 ? Ss oct.24 0:00 acpid -c /etc/acpi/events -s /var/run/acpid.socket kernoops 770 0.0 0.0 6388 956 ? Ss oct.24 0:00 /usr/sbin/kerneloops root 827 0.0 0.3 35792 6104 ? SLsl oct.24 0:00 lightdm root 876 0.7 2.6 152676 53292 tty7 Ss+ oct.24 7:14 \_ /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten t root 1268 0.0 0.1 17824 3520 ? Sl oct.24 0:00 \_ lightdm --session-child 12 19 trainee 1656 0.0 0.1 6848 2748 ? Ss oct.24 0:00 \_ init --user trainee 1784 0.0 0.0 4212 200 ? Ss oct.24 0:00 \_ ssh-agent -s trainee 1789 0.0 0.1 6136 2600 ? Ss oct.24 0:01 \_ dbus-daemon --fork --session --address=unix:abstract=/tmp/dbus-kj5 trainee 1797 0.0 0.0 4952 1048 ? Ss oct.24 0:00 \_ upstart-event-bridge trainee 1803 0.0 0.1 39460 3708 ? Ss oct.24 0:00 \_ /usr/lib/i386-linux-gnu/hud/window-stack-bridge trainee 1811 0.0 0.0 4956 600 ? S oct.24 0:00 \_ upstart-dbus-bridge --daemon --system --user --bus-name system trainee 1814 0.0 0.0 5388 916 ? S oct.24 0:00 \_ upstart-file-bridge --daemon --user trainee 1816 0.0 0.0 5020 768 ? S oct.24 0:00 \_ upstart-dbus-bridge --daemon --session --user --bus-name session trainee 1817 0.0 0.2 47160 4756 ? Ssl oct.24 0:12 \_ /usr/bin/ibus-daemon --daemonize --xim trainee 1884 0.0 0.1 38164 4028 ? Sl oct.24 0:00 | \_ /usr/lib/ibus/ibus-dconf trainee 1886 0.0 0.6 117344 13984 ? Sl oct.24 0:02 | \_ /usr/lib/ibus/ibus-ui-gtk3 trainee 1906 0.0 0.1 29884 3892 ? Sl oct.24 0:03 | \_ /usr/lib/ibus/ibus-engine-simple trainee 1832 0.0 0.8 165072 16636 ? Ssl oct.24 0:02 \_ /usr/lib/unity-settings-daemon/unity-settings-daemon trainee 1837 0.0 0.9 115088 20132 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/hud/hud-service trainee 1838 0.0 0.3 45296 6184 ? Ssl oct.24 0:00 \_ /usr/lib/at-spi2-core/at-spi-bus-launcher --launch-immediately trainee 1846 0.0 0.0 4496 1900 ? S oct.24 0:00 | \_ /bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf trainee 1839 0.0 0.7 88596 15036 ? Ssl oct.24 0:00 \_ gnome-session --session=ubuntu trainee 2125 9.8 9.1 434316 185152 ? Sl oct.24 98:20 | \_ compiz trainee 2137 0.0 0.5 44928 11244 ? Sl oct.24 0:00 | \_ /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 trainee 2140 0.0 1.5 224188 31060 ? Sl oct.24 0:15 | \_ nautilus -n trainee 2149 0.0 0.8 190792 16748 ? Sl oct.24 0:00 | \_ nm-applet trainee 2150 0.0 0.6 53008 13220 ? Sl oct.24 0:00 | \_ /usr/lib/unity-settings-daemon/unity-fallback-mount-helper trainee 2373 0.0 0.7 83088 14812 ? Sl oct.24 0:00 | \_ telepathy-indicator trainee 2547 0.0 0.8 71764 16836 ? Sl oct.24 0:00 | \_ update-notifier trainee 2597 0.0 0.2 64376 4816 ? Sl oct.24 0:00 | \_ /usr/lib/i386-linux-gnu/deja-dup/deja-dup-monitor trainee 1844 0.0 0.9 118512 20068 ? Ssl oct.24 0:03 \_ /usr/lib/unity/unity-panel-service trainee 1850 0.0 0.1 17364 3096 ? Sl oct.24 0:00 \_ /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session trainee 1858 0.0 0.1 52532 3192 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfsd trainee 1862 0.0 0.2 44088 5504 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes trainee 1892 0.0 0.5 51320 11612 ? Sl oct.24 0:00 \_ /usr/lib/ibus/ibus-x11 --kill-daemon trainee 1894 0.0 0.5 122676 11792 ? Sl oct.24 0:01 \_ /usr/lib/i386-linux-gnu/bamf/bamfdaemon trainee 1915 0.0 0.1 24512 2464 ? Sl oct.24 0:00 \_ /usr/lib/dconf/dconf-service trainee 1921 0.0 0.7 142888 15764 ? Sl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-keyboard-service --use-gtk trainee 1925 0.0 0.1 46252 3696 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-messages/indicator-messages-serv trainee 1927 0.0 0.1 38176 3788 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-bluetooth/indicator-bluetooth-se trainee 1929 0.0 0.2 38112 4064 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-power/indicator-power-service trainee 1933 0.0 0.6 100572 12396 ? Ssl oct.24 0:01 \_ /usr/lib/i386-linux-gnu/indicator-datetime/indicator-datetime-serv trainee 1938 0.0 0.2 117896 5732 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-sound/indicator-sound-service trainee 1942 0.0 0.5 57240 10572 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-printers/indicator-printers-serv trainee 1947 0.0 0.2 100412 5492 ? S<l oct.24 0:00 \_ /usr/bin/pulseaudio --start --log-target=syslog trainee 1959 0.0 0.2 63036 4388 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-session/indicator-session-servic trainee 1960 0.0 0.2 46572 4320 ? Ssl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/indicator-application/indicator-applicatio trainee 1985 0.0 0.5 89744 11604 ? Sl oct.24 0:00 \_ /usr/lib/evolution/evolution-source-registry trainee 2012 0.0 0.8 111472 17532 ? Sl oct.24 0:01 \_ /usr/lib/i386-linux-gnu/notify-osd trainee 2133 0.0 1.5 129340 31564 ? Sl oct.24 0:00 \_ /usr/lib/evolution/evolution-calendar-factory trainee 2185 0.0 0.2 47888 5528 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfs-udisks2-volume-monitor trainee 2205 0.0 0.1 9952 3112 ? S oct.24 0:00 \_ /usr/lib/i386-linux-gnu/gconf/gconfd-2 trainee 2220 0.0 0.2 28468 5048 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfs-gphoto2-volume-monitor trainee 2224 0.0 0.1 27356 2796 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfs-mtp-volume-monitor trainee 2228 0.0 0.2 38532 4968 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfs-afc-volume-monitor trainee 2234 0.0 0.3 36140 6848 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfsd-burn --spawner :1.6 /org/gtk/gvfs/exec_spaw/0 trainee 2248 0.0 0.2 63568 4300 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfsd-trash --spawner :1.6 /org/gtk/gvfs/exec_spaw/1 trainee 2295 0.0 0.7 100836 15180 ? Sl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/unity-scope-home/unity-scope-home trainee 2307 0.0 1.1 105492 22392 ? Sl oct.24 0:02 \_ /usr/bin/unity-scope-loader applications/applications.scope applic trainee 2308 0.0 0.4 92756 9572 ? Sl oct.24 0:00 \_ /usr/lib/i386-linux-gnu/unity-lens-files/unity-files-daemon trainee 2316 0.0 0.2 45216 5052 ? Sl oct.24 0:00 \_ /usr/bin/zeitgeist-daemon trainee 2325 0.0 0.6 66632 12820 ? Sl oct.24 0:01 \_ /usr/lib/i386-linux-gnu/zeitgeist-fts trainee 2332 0.0 0.0 4248 280 ? S oct.24 0:00 | \_ /bin/cat trainee 2326 0.0 0.3 68660 6356 ? Sl oct.24 0:01 \_ zeitgeist-datahub trainee 2340 0.0 0.5 67912 10316 ? Sl oct.24 0:01 \_ /usr/lib/i386-linux-gnu/unity-lens-music/unity-music-daemon trainee 2380 0.0 0.4 44580 9236 ? Sl oct.24 0:00 \_ /usr/lib/telepathy/mission-control-5 trainee 2399 0.0 0.7 82060 14704 ? Sl oct.24 0:00 \_ /usr/lib/gvfs/gvfsd-http --spawner :1.6 /org/gtk/gvfs/exec_spaw/2 trainee 2465 0.0 1.0 137812 20636 ? Sl oct.24 0:54 \_ gnome-terminal trainee 2472 0.0 0.0 2420 740 ? S oct.24 0:00 | \_ gnome-pty-helper trainee 2473 0.0 0.1 7028 3276 pts/12 Ss oct.24 0:00 | \_ bash root 11268 0.0 0.1 6844 2112 pts/12 S 10:24 0:00 | \_ sudo su - root 11269 0.0 0.0 6360 1640 pts/12 S 10:24 0:00 | \_ su - root 11270 0.0 0.1 7052 3408 pts/12 S 10:24 0:00 | \_ -su root 13230 0.0 0.0 5388 1284 pts/12 R+ 13:00 0:00 | \_ ps aux --forest trainee 12229 0.0 3.1 198876 62960 ? SNl 10:44 0:04 \_ /usr/bin/python3 /usr/bin/update-manager --no-update --no-focus-on- root 835 0.0 0.1 8852 2900 ? Ss oct.24 0:00 /usr/sbin/cups-browsed root 859 0.0 0.0 3056 912 ? Ss oct.24 0:00 cron root 873 0.0 0.3 36812 7324 ? Sl oct.24 0:00 /usr/lib/policykit-1/polkitd --no-debug root 881 0.0 0.3 36988 6456 ? Sl oct.24 0:00 /usr/lib/accountsservice/accounts-daemon root 914 0.0 0.0 2268 552 ? Ss oct.24 0:00 /bin/sh -e /proc/self/fd/9 root 917 0.0 0.0 3584 1464 ? S oct.24 0:00 \_ initctl emit plymouth-ready whoopsie 964 0.0 0.2 61204 4892 ? Ssl oct.24 0:00 whoopsie root 989 0.0 0.0 9796 1016 ? Sl oct.24 0:25 /usr/sbin/VBoxService root 1037 0.0 0.0 4648 856 tty1 Ss+ oct.24 0:00 /sbin/getty -8 38400 tty1 root 1309 0.0 0.2 37792 4112 ? Sl oct.24 0:00 /usr/lib/upower/upowerd rtkit 1368 0.0 0.0 21364 1220 ? SNl oct.24 0:01 /usr/lib/rtkit/rtkit-daemon colord 1536 0.0 0.2 37672 5732 ? Sl oct.24 0:00 /usr/lib/colord/colord trainee 1654 0.0 0.2 65140 4712 ? Sl oct.24 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login trainee 1742 0.0 0.0 9268 1676 ? Sl oct.24 0:00 /usr/bin/VBoxClient --clipboard trainee 1751 0.0 0.0 9396 1772 ? Sl oct.24 0:00 /usr/bin/VBoxClient --display trainee 1756 0.0 0.0 8232 1192 ? Sl oct.24 0:00 /usr/bin/VBoxClient --seamless trainee 1762 0.0 0.0 9916 1436 ? Sl oct.24 0:00 /usr/bin/VBoxClient --draganddrop root 2208 0.0 0.2 53264 5336 ? Sl oct.24 0:00 /usr/lib/udisks2/udisksd --no-debug root 2983 0.0 0.1 8156 2884 ? Ss oct.24 0:00 /usr/sbin/cupsd -f root 11447 0.0 0.2 37380 5880 ? Ssl 10:43 0:00 /usr/sbin/ModemManager root 11453 0.0 0.3 53736 6400 ? Ssl 10:43 0:00 NetworkManager nobody 11463 0.0 0.0 5612 1500 ? S 10:43 0:00 \_ /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interf root 13084 0.0 0.1 5516 3092 ? S 12:54 0:00 \_ /sbin/dhclient -d -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /ru daemon 12200 0.0 0.0 2644 124 ? Ss 10:43 0:00 atd
La commande pstree
Tout comme l'option –forest de la commande ps, cette commande affiche les processus en forme d'arborescence, démontrant ainsi les processus parents en enfants :
root@ubuntu:~# pstree init─┬─ModemManager───2*[{ModemManager}] ├─NetworkManager─┬─dhclient │ ├─dnsmasq │ └─3*[{NetworkManager}] ├─3*[VBoxClient───{VBoxClient}] ├─VBoxClient───2*[{VBoxClient}] ├─VBoxService───7*[{VBoxService}] ├─accounts-daemon───2*[{accounts-daemon}] ├─acpid ├─atd ├─avahi-daemon───avahi-daemon ├─bluetoothd ├─colord───2*[{colord}] ├─cron ├─cups-browsed ├─cupsd ├─dbus-daemon ├─6*[getty] ├─gnome-keyring-d───6*[{gnome-keyring-d}] ├─kerneloops ├─lightdm─┬─Xorg │ ├─lightdm─┬─init─┬─at-spi-bus-laun─┬─dbus-daemon │ │ │ │ └─3*[{at-spi-bus-laun}] │ │ │ ├─at-spi2-registr───{at-spi2-registr} │ │ │ ├─bamfdaemon───3*[{bamfdaemon}] │ │ │ ├─dbus-daemon │ │ │ ├─dconf-service───2*[{dconf-service}] │ │ │ ├─evolution-calen───4*[{evolution-calen}] │ │ │ ├─evolution-sourc───2*[{evolution-sourc}] │ │ │ ├─gconfd-2 │ │ │ ├─gnome-session─┬─compiz───4*[{compiz}] │ │ │ │ ├─deja-dup-monito───2*[{deja-dup-monito}] │ │ │ │ ├─nautilus───3*[{nautilus}] │ │ │ │ ├─nm-applet───2*[{nm-applet}] │ │ │ │ ├─polkit-gnome-au───2*[{polkit-gnome-au}] │ │ │ │ ├─telepathy-indic───2*[{telepathy-indic}] │ │ │ │ ├─unity-fallback-───2*[{unity-fallback-}] │ │ │ │ ├─update-notifier───3*[{update-notifier}] │ │ │ │ └─3*[{gnome-session}] │ │ │ ├─gnome-terminal─┬─bash───sudo───su───bash───pstree │ │ │ │ ├─gnome-pty-helpe │ │ │ │ └─3*[{gnome-terminal}] │ │ │ ├─gvfs-afc-volume───2*[{gvfs-afc-volume}] │ │ │ ├─gvfs-gphoto2-vo───{gvfs-gphoto2-vo} │ │ │ ├─gvfs-mtp-volume───{gvfs-mtp-volume} │ │ │ ├─gvfs-udisks2-vo───2*[{gvfs-udisks2-vo}] │ │ │ ├─gvfsd───{gvfsd} │ │ │ ├─gvfsd-burn───2*[{gvfsd-burn}] │ │ │ ├─gvfsd-fuse───4*[{gvfsd-fuse}] │ │ │ ├─gvfsd-http───3*[{gvfsd-http}] │ │ │ ├─gvfsd-trash───5*[{gvfsd-trash}] │ │ │ ├─hud-service───3*[{hud-service}] │ │ │ ├─ibus-daemon─┬─ibus-dconf───3*[{ibus-dconf}] │ │ │ │ ├─ibus-engine-sim───2*[{ibus-engine-sim}] │ │ │ │ ├─ibus-ui-gtk3───3*[{ibus-ui-gtk3}] │ │ │ │ └─2*[{ibus-daemon}] │ │ │ ├─ibus-x11───3*[{ibus-x11}] │ │ │ ├─indicator-appli───{indicator-appli} │ │ │ ├─indicator-bluet───2*[{indicator-bluet}] │ │ │ ├─indicator-datet───5*[{indicator-datet}] │ │ │ ├─indicator-keybo───2*[{indicator-keybo}] │ │ │ ├─indicator-messa───3*[{indicator-messa}] │ │ │ ├─indicator-power───2*[{indicator-power}] │ │ │ ├─indicator-print───2*[{indicator-print}] │ │ │ ├─indicator-sessi───2*[{indicator-sessi}] │ │ │ ├─indicator-sound───3*[{indicator-sound}] │ │ │ ├─mission-control───2*[{mission-control}] │ │ │ ├─notify-osd───2*[{notify-osd}] │ │ │ ├─pulseaudio───2*[{pulseaudio}] │ │ │ ├─ssh-agent │ │ │ ├─unity-files-dae───4*[{unity-files-dae}] │ │ │ ├─unity-music-dae───2*[{unity-music-dae}] │ │ │ ├─unity-panel-ser───2*[{unity-panel-ser}] │ │ │ ├─unity-scope-hom───2*[{unity-scope-hom}] │ │ │ ├─unity-scope-loa───3*[{unity-scope-loa}] │ │ │ ├─unity-settings-───3*[{unity-settings-}] │ │ │ ├─update-manager───2*[{update-manager}] │ │ │ ├─2*[upstart-dbus-br] │ │ │ ├─upstart-event-b │ │ │ ├─upstart-file-br │ │ │ ├─window-stack-br │ │ │ ├─zeitgeist-daemo───{zeitgeist-daemo} │ │ │ ├─zeitgeist-datah───3*[{zeitgeist-datah}] │ │ │ └─zeitgeist-fts─┬─cat │ │ │ └─2*[{zeitgeist-fts}] │ │ └─{lightdm} │ └─2*[{lightdm}] ├─polkitd───2*[{polkitd}] ├─rsyslogd───3*[{rsyslogd}] ├─rtkit-daemon───2*[{rtkit-daemon}] ├─sh───initctl ├─systemd-logind ├─systemd-udevd ├─udisksd───4*[{udisksd}] ├─upowerd───2*[{upowerd}] ├─upstart-file-br ├─upstart-socket- ├─upstart-udev-br └─whoopsie───2*[{whoopsie}]
Options de la commande pstree
root@ubuntu:~# pstree --help pstree : option non reconnue « --help » Usage: pstree [ -a ] [ -c ] [ -h | -H PID ] [ -l ] [ -n ] [ -p ] [ -g ] [ -u ] [ -A | -G | -U ] [ PID | UTILISATEUR ] pstree -V Affiche l'arborescence des processus. -a, --arguments afficher les paramètres de la ligne de commande -A, --ascii utiliser les caractères de tracé ASCII -c, --compact ne pas grouper des branches identiques -h, --highlight-all surligner le processus courant et ses parents -H PID, --highlight-pid=PID surligner le processus spécifié et ses parents -g, --show-pgids afficher les ID des groupes du processus (implique -c) -G, --vt100 utiliser les caractères de tracé VT100 -l, --long ne pas tronquer les longues lignes -n, --numeric-sort trier le résultat par PID -p, --show-pids afficher les PIDs (implique -c) -s, --show-parents afficher les parents du processus sélectionné -u, --uid-changes montrer les transitions de uid -U, --unicode utiliser les caractères de tracé UTF-8 (Unicode) -V, --version afficher les informations sur la version PID commence à ce PID; le défaut est 1 (init) USER montre seulement les arbres nichés aux processus de cet utilisateur
La commande top
Cette commande indique les processus en mémoire :
top - 13:02:57 up 16:43, 2 users, load average: 0,18, 0,15, 0,12 Tasks: 191 total, 2 running, 189 sleeping, 0 stopped, 0 zombie %Cpu(s): 7,2 us, 2,8 sy, 0,0 ni, 90,0 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem: 2015632 total, 1219828 used, 795804 free, 99572 buffers KiB Swap: 1997820 total, 0 used, 1997820 free. 584056 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2125 trainee 20 0 434316 185152 36588 S 6,0 9,2 98:38.69 compiz 876 root 20 0 152676 53292 15548 S 2,8 2,6 7:20.21 Xorg 2465 trainee 20 0 137900 20744 13952 S 0,9 1,0 0:56.82 gnome-terminal 13236 root 20 0 5548 1444 1028 R 0,5 0,1 0:00.18 top 23 root 20 0 0 0 0 R 0,2 0,0 0:26.63 kworker/0:1 1817 trainee 20 0 47160 4756 3616 S 0,2 0,2 0:12.28 ibus-daemon 1906 trainee 20 0 29884 3892 3396 S 0,2 0,2 0:03.63 ibus-engine-sim 1 root 20 0 4576 2552 1440 S 0,0 0,1 0:01.19 init 2 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kthreadd 3 root 20 0 0 0 0 S 0,0 0,0 0:00.78 ksoftirqd/0 5 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 kworker/0:0H 7 root 20 0 0 0 0 S 0,0 0,0 0:02.04 rcu_sched 8 root 20 0 0 0 0 S 0,0 0,0 0:00.00 rcu_bh 9 root rt 0 0 0 0 S 0,0 0,0 0:00.00 migration/0 10 root rt 0 0 0 0 S 0,0 0,0 0:01.43 watchdog/0 11 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 khelper 12 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kdevtmpfs 13 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 netns 14 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 writeback 15 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 kintegrityd 16 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 bioset 17 root 0 -20 0 0 0 S 0,0 0,0 0:00.14 kworker/u3:0 18 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 kblockd 19 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 ata_sff 20 root 20 0 0 0 0 S 0,0 0,0 0:00.05 khubd 21 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 md 22 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 devfreq_wq 24 root 20 0 0 0 0 S 0,0 0,0 0:00.04 khungtaskd ...
Pour afficher l'aide de la commande top, appuyez sur la touche h :
Help for Interactive Commands - procps-ng version 3.3.9 Window 1:Def: Cumulative mode Off. System: Delay 10,0 secs; Secure mode Off. Z,B,E,e Global: 'Z' colors; 'B' bold; 'E'/'e' summary/task memory scale l,t,m Toggle Summary: 'l' load avg; 't' task/cpu stats; 'm' memory info 0,1,2,3,I Toggle: '0' zeros; '1/2/3' cpus or numa node views; 'I' Irix mode f,F,X Fields: 'f'/'F' add/remove/order/sort; 'X' increase fixed-width L,&,<,> . Locate: 'L'/'&' find/again; Move sort column: '<'/'>' left/right R,H,V,J . Toggle: 'R' Sort; 'H' Threads; 'V' Forest view; 'J' Num justify c,i,S,j . Toggle: 'c' Cmd name/line; 'i' Idle; 'S' Time; 'j' Str justify x,y . Toggle highlights: 'x' sort field; 'y' running tasks z,b . Toggle: 'z' color/mono; 'b' bold/reverse (only if 'x' or 'y') u,U,o,O . Filter by: 'u'/'U' effective/any user; 'o'/'O' other criteria n,#,^O . Set: 'n'/'#' max tasks displayed; Show: Ctrl+'O' other filter(s) C,... . Toggle scroll coordinates msg for: up,down,left,right,home,end k,r Manipulate tasks: 'k' kill; 'r' renice d or s Set update interval W,Y Write configuration file 'W'; Inspect other output 'Y' q Quit ( commands shown with '.' require a visible task display window ) Press 'h' or '?' for help with Windows, Type 'q' or <Esc> to continue
Pour revenir à l'affichage précédent, appuyez sur q.
Au lancement, le temps de rafraîchissement de la liste est de 3 secondes. Pour modifier ce temps à 1 seconde, appuyez sur la touche s puis la touche 1 et validez :
top - 13:04:00 up 16:44, 2 users, load average: 0,06, 0,12, 0,12 Tasks: 191 total, 1 running, 190 sleeping, 0 stopped, 0 zombie %Cpu(s): 3,6 us, 1,0 sy, 0,0 ni, 95,4 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem: 2015632 total, 1220080 used, 795552 free, 99588 buffers KiB Swap: 1997820 total, 0 used, 1997820 free. 584064 cached Mem Change delay from 3,0 to 1 ...
Pour trier la liste selon l'utilisation de la mémoire, appuyez sur la touche M :
top - 13:04:33 up 16:45, 2 users, load average: 0,04, 0,11, 0,11 Tasks: 191 total, 3 running, 188 sleeping, 0 stopped, 0 zombie %Cpu(s): 1,0 us, 0,8 sy, 0,0 ni, 98,2 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem: 2015632 total, 1219832 used, 795800 free, 99596 buffers KiB Swap: 1997820 total, 0 used, 1997820 free. 584064 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2125 trainee 20 0 434316 185152 36588 S 0,6 9,2 98:43.52 compiz 12229 trainee 30 10 198876 62960 40852 S 0,0 3,1 0:04.05 update-manager 876 root 20 0 152676 53292 15548 S 0,4 2,6 7:21.95 Xorg 2133 trainee 20 0 129340 31564 7356 S 0,0 1,6 0:00.35 evolution-calen 2140 trainee 20 0 224188 31060 23156 S 0,0 1,5 0:15.60 nautilus 2307 trainee 20 0 105492 22392 10824 S 0,0 1,1 0:02.19 unity-scope-loa 2465 trainee 20 0 137900 20744 13952 R 0,5 1,0 0:57.47 gnome-terminal 1837 trainee 20 0 115088 20132 14756 S 0,0 1,0 0:00.62 hud-service 1844 trainee 20 0 118512 20068 11852 S 0,0 1,0 0:03.85 unity-panel-ser 2012 trainee 20 0 111472 17532 11968 S 0,0 0,9 0:01.84 notify-osd 2547 trainee 20 0 71764 16836 10036 S 0,0 0,8 0:00.46 update-notifier 2149 trainee 20 0 190792 16748 12832 S 0,0 0,8 0:00.65 nm-applet 1832 trainee 20 0 165072 16636 11392 S 0,0 0,8 0:02.47 unity-settings- 1921 trainee 20 0 142888 15764 8244 S 0,0 0,8 0:00.34 indicator-keybo 2295 trainee 20 0 100836 15180 9252 S 0,0 0,8 0:00.46 unity-scope-hom 1839 trainee 20 0 88596 15036 8396 S 0,0 0,7 0:00.47 gnome-session 2373 trainee 20 0 83088 14812 8448 S 0,0 0,7 0:00.26 telepathy-indic 2399 trainee 20 0 82060 14704 5368 S 0,0 0,7 0:00.34 gvfsd-http 1886 trainee 20 0 117344 13984 10580 S 0,0 0,7 0:02.73 ibus-ui-gtk3 2150 trainee 20 0 53008 13220 7020 S 0,0 0,7 0:00.28 unity-fallback- 2325 trainee 20 0 66632 12820 7044 S 0,0 0,6 0:01.07 zeitgeist-fts 1933 trainee 20 0 100572 12396 6260 S 0,0 0,6 0:01.30 indicator-datet 1894 trainee 20 0 122676 11792 8424 S 0,0 0,6 0:01.32 bamfdaemon 1892 trainee 20 0 51320 11612 6124 S 0,0 0,6 0:00.07 ibus-x11 1985 trainee 20 0 89744 11604 7516 S 0,0 0,6 0:00.09 evolution-sourc 2137 trainee 20 0 44928 11244 7132 S 0,0 0,6 0:00.24 polkit-gnome-au 1942 trainee 20 0 57240 10572 8096 S 0,0 0,5 0:00.30 indicator-print 2340 trainee 20 0 67912 10316 6760 S 0,0 0,5 0:01.06 unity-music-dae ...
Pour visualiser les processus qui utilisent le processeur, appuyez sur la touche i :
top - 13:04:51 up 16:45, 2 users, load average: 0,03, 0,10, 0,11 Tasks: 191 total, 2 running, 189 sleeping, 0 stopped, 0 zombie %Cpu(s): 0,9 us, 0,3 sy, 0,0 ni, 98,8 id, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st KiB Mem: 2015632 total, 1219956 used, 795676 free, 99600 buffers KiB Swap: 1997820 total, 0 used, 1997820 free. 584064 cached Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 2125 trainee 20 0 434316 185152 36588 S 0,8 9,2 98:44.54 compiz 876 root 20 0 152676 53292 15548 S 0,3 2,6 7:22.27 Xorg 2465 trainee 20 0 138060 20744 13952 S 0,3 1,0 0:57.60 gnome-terminal 13236 root 20 0 5548 1444 1028 R 0,1 0,1 0:00.27 top 989 root 20 0 9796 1016 724 S 0,1 0,1 0:25.95 VBoxService
Pour quitter top, appuyez sur la touche q.
Options de la commande top
root@ubuntu:~# top --help top: inappropriate '-help' Usage: top -hv | -bcHiOSs -d secs -n max -u|U user -p pid(s) -o field -w [cols]
Les commandes fg et bg
Normalement les commandes s’exécutent en avant plan. Vous pouvez également lancer des processus en arrière plan (en tâche de fond). Si vous lancez une commande en tâche de fond, il faut rajouter (espace)& à la fin de la commande :
# sleep 9999 &
Notez qu’un processus en arrière plan est dit asynchrone car il se poursuit indépendamment de son parent qui est le shell. En avant plan le processus est dit synchrone.
Linux numérote tous les processus qui sont placés en tâches de fond. On parle donc d’un numéro de tâche.
La commande jobs permet de se renseigner sur les processus en arrière plan :
root@ubuntu:~# sleep 9999 & [1] 13253 root@ubuntu:~# jobs -l [1]+ 13253 En cours d'exécution sleep 9999 &
Notez que le numéro de tâche est indiqué entre [crochets] tandis que le PID ne l'est pas. Le signe + qui suit le numéro de tâche [1] indique que la tâche est la dernière a avoir été manipulée.
Si on souhaite envoyer un processus en arrière plan de façon à libérer le shell pour d’autres commandes, il faut d’abord suspendre le processus en question. Normalement on suspend un processus en utilisant la combinaison de touches CtrlZ.
Par exemple :
root@ubuntu:~# sleep 1234 ^Z [2]+ Arrêté sleep 1234
Un fois suspendu, on utilise la commande bg (background) suivi par % et le numéro de tâche pour envoyer le processus en arrière plan :
root@ubuntu:~# bg %2 [2]+ sleep 1234 & root@ubuntu:~# jobs -l [1]- 13253 En cours d'exécution sleep 9999 & [2]+ 13254 En cours d'exécution sleep 1234 &
Notez que lors du passage en arrière plan, le processus reprend son exécution normalement. Le caractère - qui suit le numéro de tâche [1] indique que la tâche est l'avant-dernière a avoir été manipulée.
Pour ramener le processus en avant plan, il faut de nouveau interrompre le processus concerné. Or cette fois-ci, nous ne pouvons pas utiliser la commande CtrlZ. Il faut donc envoyer un signal au processus en utilisant la commande kill avec l’opérateur –stop.
root@ubuntu:~# kill -stop %2 root@ubuntu:~# jobs -l [1]- 13253 En cours d'exécution sleep 9999 & [2]+ 13254 Signal d'arrêt sleep 1234
Pour reprendre le processus en arrière plan, sans le ramener en avant plan, on utilise la commande kill avec l'option -cont :
root@ubuntu:~# kill -cont %2 root@ubuntu:~# jobs -l [1]- 13253 En cours d'exécution sleep 9999 & [2]+ 13254 En cours d'exécution sleep 1234 &
ou pour ramener le processus en avant plan, on utilise la commande fg :
root@ubuntu:~# kill -stop %2 [2]+ Arrêté sleep 1234 root@ubuntu:~# jobs -l [1]- 13253 En cours d'exécution sleep 9999 & [2]+ 13254 Signal d'arrêt sleep 1234 root@ubuntu:~# fg %2 sleep 1234 ^C
Notez l'utilisation des touches CtrlCtrl pour tuer le processus en avant plan.
Options de la commande jobs
Les options de la commande jobs sont :
root@ubuntu:~# help jobs jobs: jobs [-lnprs] [jobspec ...] ou jobs -x commande [args] Display status of jobs. Lists the active jobs. JOBSPEC restricts output to that job. Without options, the status of all active jobs is displayed. Options: -l lists process IDs in addition to the normal information -n lists only processes that have changed status since the last notification -p lists process IDs only -r restrict output to running jobs -s restrict output to stopped jobs If -x is supplied, COMMAND is run after all job specifications that appear in ARGS have been replaced with the process ID of that job's process group leader. Exit Status: Returns success unless an invalid option is given or an error occurs. If -x is used, returns the exit status of COMMAND.
La commande wait
Cette commande permet de doter un processus asynchrone du comportement d'un processus synchrone. Elle est utilisée pour attendre jusqu’à ce qu'un processus en tâche de fond soit terminé :
root@ubuntu:~# jobs -l [1]+ 13253 En cours d'exécution sleep 9999 & root@ubuntu:~# wait %1 ^C root@ubuntu:~# jobs -l [1]+ 13253 En cours d'exécution sleep 9999 &
Notez que l'utilisation des touches CtrlC tue le processus généré par la commande wait et non le processus généré par la commande sleep.
La commande nice
Cette commande affiche ou modifie la priorité d’un processus. La priorité par défaut de nice est 10. La valeur de nice la plus prioritaire est -20. La valeur la moins prioritaire est 19 :
root@ubuntu:~# nice -n -20 sleep 1234 ^Z [2]+ Arrêté nice -n -20 sleep 1234 root@ubuntu:~# nice -n 19 sleep 5678 ^Z [3]+ Arrêté nice -n 19 sleep 5678 root@ubuntu:~# ps lx | grep sleep 0 0 13253 11270 20 0 4228 540 hrtime S pts/12 0:00 sleep 9999 4 0 13268 11270 0 -20 4228 536 signal T< pts/12 0:00 sleep 1234 0 0 13269 11270 39 19 4228 540 signal TN pts/12 0:00 sleep 5678 0 0 13274 11270 20 0 4700 820 pipe_w S+ pts/12 0:00 grep --color=auto sleep
Comme vous pouvez constater la 6ième colonne contient la valeur de nice qui s'applique à la priorité dans la colonne 5.
Notez que seul root peut lancer des processus avec une valeur négative.
Options de la commande
Les options de cette commande sont :
root@ubuntu:~# nice --help Utilisation : nice [OPTION] [COMMAND] [ARG]... Exécuter COMMAND avec un niveau de priorité ajusté, modifiant la priorité d'ordonnancement du processus. Sans COMMAND, afficher le niveau de priorité actuel. L'étendue des niveaux va de -20 (priorité la plus favorable au processus) à 19 (la moins favorable). Les arguments obligatoires pour les options longues le sont aussi pour les options courtes. -n, --adjustment=N ajoute la valeur entière N à la valeur de la priorité (10 par défaut) --help afficher l'aide et quitter --version afficher des informations de version et quitter Remarque : l'interpréteur de commande peut avoir sa propre version de nice, lequel remplace habituellement la version décrite ici. Consultez la documentation de l'interpréteur pour obtenir des précisions sur les options prises en charge. Signalez les anomalies de « nice » à <bug-coreutils@gnu.org> Page d'accueil de « GNU coreutils » : http://www.gnu.org/software/coreutils/ Aide globale sur les logiciels GNU : <http://www.gnu.org/help/gethelp> Signalez les problèmes de traduction de « nice » à : <traduc@traduc.org> Utilisez « info coreutils 'nice invocation' » pour toute la documentation
La commande renice
Cette commande modifie la priorité d’un processus déjà en cours. La valeur de la priorité ne peut être modifiée que par le propriétaire du processus ou par root.
root@ubuntu:~# jobs -l [1] 13253 En cours d'exécution sleep 9999 & [2]- 13268 Arrêté nice -n -20 sleep 1234 [3]+ 13269 Arrêté nice -n 19 sleep 5678 root@ubuntu:~# bg %2 [2]- nice -n -20 sleep 1234 & root@ubuntu:~# bg %3 [3]+ nice -n 19 sleep 5678 & root@ubuntu:~# jobs -l [1] 13253 En cours d'exécution sleep 9999 & [2]- 13268 En cours d'exécution nice -n -20 sleep 1234 & [3]+ 13269 En cours d'exécution nice -n 19 sleep 5678 & root@ubuntu:~# renice +5 13253 13253 (process ID) old priority 0, new priority 5 root@ubuntu:~# renice 5 13268 13268 (process ID) old priority 5, new priority 5 root@ubuntu:~# renice -5 13269 13269 (process ID) old priority 19, new priority -5
Options de la commande
Les options de cette commande sont :
root@ubuntu:~# renice --help Usage: renice [-n] <priority> [-p] <pid> [<pid> ...] renice [-n] <priority> -g <pgrp> [<pgrp> ...] renice [-n] <priority> -u <user> [<user> ...] Options : -g, --pgrp <id> interpret as process group ID -h, --help print help -n, --priority <num> set the nice increment value -p, --pid <id> force to be interpreted as process ID -u, --user <name|id> interpret as username or user ID -v, --version print version For more information see renice(1).
La commande nohup
Cette commande permet à un processus de poursuivre son exécution après la déconnexion. Un processus enfant meurt quand le processus parent meure ou se termine. Comme une connexion et un processus, quand vous vous déconnectez, vos processus se terminent. Pour éviter de rester connecté après avoir lancé un processus long, vous utiliserez la commande nohup :
nohup lp ventes.txt &
Options de la commande
Les options de cette commande sont :
root@ubuntu:~# nohup --help Utilisation : nohup COMMAND [ARG]... ou : nohup OPTION Exécuter COMMAND en ignorant les signaux de déconnexion. --help afficher l'aide et quitter --version afficher des informations de version et quitter Si l'entrée standard est un terminal, la rediriger depuis /dev/null. Si l'entrée standard est un terminal, ajouter si possible la sortie à « nohup.out » ou à « $HOME/nohup.out » sinon. Si la sortie d'erreur standard est un terminal, la rediriger vers la sortie standard. Pour enregistrer la sortie dans FILE, utilisez « nohup COMMAND > FILE ». Remarque : l'interpréteur de commande peut avoir sa propre version de nohup, lequel remplace habituellement la version décrite ici. Consultez la documentation de l'interpréteur pour obtenir des précisions sur les options prises en charge. Signalez les anomalies de « nohup » à <bug-coreutils@gnu.org> Page d'accueil de « GNU coreutils » : http://www.gnu.org/software/coreutils/ Aide globale sur les logiciels GNU : <http://www.gnu.org/help/gethelp> Signalez les problèmes de traduction de « nohup » à : <traduc@traduc.org> Utilisez « info coreutils 'nohup invocation' » pour toute la documentation
La commande kill
La commande kill envoie des signaux aux processus. La liste des signaux possibles peut être afficher avec l'option -l :
root@ubuntu:~# kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM 16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR 31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3 38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8 43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13 48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12 53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7 58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2 63) SIGRTMAX-1 64) SIGRTMAX
Vous constaterez que chaque signal possède un numéro. Ces numéros de signaux sont utilisés à la place des options. Par exemple, -19 à la place de l'option -stop.
Parmi les numéros de signaux les plus utiles on trouve :
Numéro | Description |
---|---|
-1 | Le signal Hang Up est envoyé à tous les enfants d'un processus quand il se termine |
-2 | Interruption du processus - équivalent à CtrlC |
-3 | La même chose que -2 mais avec la génération d'un fichier de déboggage |
-9 | Le signal qui tue un processus brutalement |
-15 | Le signal envoyé par défaut par la commande kill. Le processus se termine normalement |
<html> <center> Copyright © 2004-2016 Hugh Norris.<br><br> <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/fr/”><img alt=“Licence Creative Commons” style=“border-width:0” src=“http://i.creativecommons.org/l/by-nc-nd/3.0/fr/88x31.png” /></a><br />Ce(tte) oeuvre est mise à disposition selon les termes de la <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/fr/”>Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Pas de Modification 3.0 France</a>. </center> </html>