Sep 24
pstree is used for displaying a tree of processes . with pstree options we find details about processes, the syntax of pstree command is
pstree options
Examples
1. [root@myserver ~]# pstree (Dispaly all processes)
init─┬─acpid
├─atd
├─bonobo-activati
├─cannaserver
├─clock-applet
├─crond
├─cups-config-dae
├─cupsd
├─2*[dbus-daemon-1]
├─dbus-launch
├─eggcups
├─events/0─┬─aio/0
│ ├─aio/1
│ ├─ata/0
│ ├─ata/1
│ ├─kacpid
│ ├─kauditd
│ ├─kblockd/0
│ ├─kblockd/1
│ ├─khelper
│ ├─kmir_mon
│ ├─kmirrord
│ └─2*[pdflush]
├─events/1─┬─kmpathd/0
│ └─kmpathd/1
├─firefox───run-mozilla.sh───firefox-bin───netstat
├─gam_server
├─gconfd-2
├─gdm-binary───gdm-binary─┬─X
│ └─gnome-session
├─gnome-keyring-d
├─gnome-panel
├─gnome-settings-
├─gnome-terminal─┬─bash───pstree
│ ├─bash
│ └─gnome-pty-helpe
├─gnome-vfs-daemo
├─gnome-volume-ma
├─gpm
├─hald
├─htt───htt_server
├─irqbalance
├─khubd
├─2*[kjournald]
├─klogd
├─kseriod
├─ksoftirqd/0
├─ksoftirqd/1
├─kswapd0
├─mapping-daemon
├─metacity
├─migration/0
├─migration/1
├─6*[mingetty]
├─mixer_applet2
├─nautilus
├─nautilus-throbb
├─notification-ar
├─pam-panel-icon───pam_timestamp_c
├─rpc.idmapd
├─scsi_eh_0
├─ssh-agent
├─sshd
├─syslogd
├─udevd
├─vino-server
├─wnck-applet
├─xfs
└─xinetd
2. [root@myserver ~]# pstree -p (all processes with process ID)
init(1)─┬─acpid(2721)
├─atd(2945)
├─bonobo-activati(12511)
├─cannaserver(2876)
├─clock-applet(12589)
├─crond(2888)
├─cups-config-dae(2977)
├─cupsd(4003)
├─dbus-daemon-1(12502)
├─dbus-daemon-1(2964)
├─dbus-launch(12501)
├─eggcups(12566)
├─events/0(6)─┬─aio/0(42)
│ ├─aio/1(43)
│ ├─ata/0(198)
│ ├─ata/1(199)
│ ├─kacpid(9)
│ ├─kauditd(1861)
│ ├─kblockd/0(28)
│ ├─kblockd/1(29)
│ ├─khelper(8)
│ ├─kmir_mon(2092)
│ ├─kmirrord(2091)
│ ├─pdflush(39)
│ └─pdflush(40)
├─events/1(7)─┬─kmpathd/0(2084)
│ └─kmpathd/1(2085)
├─firefox(12593)───run-mozilla.sh(12612)───firefox-bin(12617)───netstat+ ├─gam_server(12519)
├─gconfd-2(12506)
├─gdm-binary(3005)───gdm-binary(3371)─┬─X(3376)
│ └─gnome-session(12438)
├─gnome-keyring-d(12509)
├─gnome-panel(12557)
├─gnome-settings-(12513)
├─gnome-terminal(12725)─┬─bash(12727)───man(14007)───sh(14009)───less(1+ │ ├─bash(13965)───pstree(14082)
│ └─gnome-pty-helpe(12726)
├─gnome-vfs-daemo(12575)
├─gnome-volume-ma(12561)
├─gpm(2832)
├─hald(2988)
├─htt(2863)───htt_server(2864)
├─irqbalance(2568)
├─khubd(30)
├─kjournald(212)
├─kjournald(2110)
├─klogd(2557)
├─kseriod(117)
├─ksoftirqd/0(3)
├─ksoftirqd/1(5)
├─kswapd0(41)
├─mapping-daemon(12582)
├─metacity(12553)
├─migration/0(2)
├─migration/1(4)
├─mingetty(2998)
├─mingetty(2999)
├─mingetty(3001)
├─mingetty(3002)
├─mingetty(3003)
├─mingetty(3004)
├─mixer_applet2(12587)
├─nautilus(12559)
├─nautilus-throbb(13189)
├─notification-ar(12591)
├─pam-panel-icon(12568)───pam_timestamp_c(12571)
├─rpc.idmapd(2619)
├─scsi_eh_0(203)
├─ssh-agent(12468)
├─sshd(2807)
├─syslogd(2553)
├─udevd(1121)
├─vino-server(12545)
├─wnck-applet(12585)
├─xfs(2926)
└─xinetd(2822)
3. [root@myserver ~]# pstree -a (processes with command line arguments and path)
init
├─acpid
├─atd
├─bonobo-activati –ac-activate –ior-output-fd=18
├─cannaserver -syslog -u canna
├─clock-applet –oaf-activate-iid=OAFIID:GNOME_ClockApplet_Factory–
├─crond
├─cups-config-dae
├─cupsd
├─dbus-daemon-1 –fork –print-pid 8 –print-address 6 –session
├─dbus-daemon-1 –system
├─dbus-launch –exit-with-session /etc/X11/xinit/Xclients
├─eggcups –sm-client-id default5
├─(events/0)
│ ├─(aio/0)
│ ├─(aio/1)
│ ├─(ata/0)
│ ├─(ata/1)
│ ├─(kacpid)
│ ├─(kauditd)
│ ├─(kblockd/0)
│ ├─(kblockd/1)
│ ├─(khelper)
│ ├─(kmir_mon)
│ ├─(kmirrord)
│ ├─(pdflush)
│ └─(pdflush)
├─(events/1)
│ ├─(kmpathd/0)
│ └─(kmpathd/1)
├─firefox /usr/lib/firefox-1.0.7/firefox -UILocale en-US
│ └─run-mozilla.sh /usr/lib/firefox-1.0.7/run-mozilla.sh…
│ └─firefox-bin -UILocale en-US
│ └─(netstat)
├─gam_server
├─gconfd-2 5
├─gdm-binary -nodaemon
│ └─gdm-binary -nodaemon
│ ├─X :0 -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7
│ └─gnome-session
├─gnome-keyring-d
├─gnome-panel –sm-client-id default2
├─gnome-settings—oaf-activate-iid=OAFIID:GNOME_SettingsDaemo
├─gnome-terminal
│ ├─bash
│ │ └─pstree -a
│ ├─bash
│ │ └─man pstree
│ │ └─sh -c…
│ │ └─less -iRs
│ └─gnome-pty-helpe
├─gnome-vfs-daemo–oaf-activate-iid=OAFIID:GNOME_VFS_Daemon_Factory
├─gnome-volume-ma –sm-client-id default6
├─gpm -m /dev/input/mice -t imps2
├─hald
├─htt -retryonerror 0
│ └─htt_server -nodaemon
├─irqbalance
├─(khubd)
├─(kjournald)
├─(kjournald)
├─klogd -x
├─(kseriod)
├─(ksoftirqd/0)
├─(ksoftirqd/1)
├─(kswapd0)
├─mapping-daemon
├─metacity –sm-client-id=default1
├─(migration/0)
├─(migration/1)
├─mingetty tty1
├─mingetty tty2
├─mingetty tty3
├─mingetty tty4
├─mingetty tty5
├─mingetty tty6
├─mixer_applet2 –oaf-activate-iid=OAFIID:GNOME_MixerApplet_Factory-
├─nautilus –no-default-window –sm-client-id default3
├─nautilus-throbb–oaf-activate-iid=OAFIID:Nautilus_Throbber_Facto
├─notification-ar–oaf-activate-iid=OAFIID:GNOME_Notificati
├─pam-panel-icon –sm-client-id default0
│ └─pam_timestamp_c -d root
├─rpc.idmapd
├─(scsi_eh_0)
├─ssh-agent -s
├─sshd
├─syslogd -m 0
├─udevd
├─vino-server –oaf-activate-iid=OAFIID:GNOME_RemoteDesktopServer–o
├─wnck-applet –oaf-activate-iid=OAFIID:GNOME_Wncklet_Factory–oaf-i
├─xfs -droppriv -daemon
└─xinetd -stayalive -pidfile /var/run/xinetd.pid
Sep 22
The ps command is used for manage the running process in our system.
Example :
1) VIT:/home/antony# ps
PID TTY TIME CMD
4717 pts/5 00:00:00 bash
4724 pts/5 00:00:00 ps
This command displays the active processes on your system
2) VIT:/home/antony# ps -e
PID TTY TIME CMD
1 ? 00:00:01 init
2 ? 00:00:00 migration/0
3 ? 00:00:00 ksoftirqd/0
4 ? 00:00:00 events/0
5 ? 00:00:00 khelper
6 ? 00:00:00 kthread
9 ? 00:00:00 kblockd/0
10 ? 00:00:00 kacpid
102 ? 00:00:00 kseriod
142 ? 00:00:00 pdflush
143 ? 00:00:00 pdflush
144 ? 00:00:00 kswapd0
145 ? 00:00:00 aio/0
588 ? 00:00:00 ata/0
590 ? 00:00:00 ata_aux
591 ? 00:00:00 khubd
593 ? 00:00:00 scsi_eh_0
595 ? 00:00:00 scsi_eh_1
1066 ? 00:00:00 kjournald
1247 ? 00:00:00 udevd
1632 ? 00:00:00 kpsmoused
1650 ? 00:00:00 kgameportd
1956 ? 00:00:00 kmirrord
2009 ? 00:00:00 kjournald
2340 ? 00:00:00 portmap
2592 ? 00:00:00 syslogd
2598 ? 00:00:00 klogd
2612 ? 00:00:00 named
2638 ? 00:00:00 lwresd
2662 ? 00:00:00 hpiod
2665 ? 00:00:00 python
2702 ? 00:00:00 postmaster
2705 ? 00:00:00 postmaster
2706 ? 00:00:00 postmaster
2707 ? 00:00:00 postmaster
2791 ? 00:00:00 acpid
2798 ? 00:00:00 dbus-daemon
2806 ? 00:00:03 hald
2807 ? 00:00:00 hald-runner
2813 ? 00:00:00 hald-addon-acpi
2817 ? 00:00:00 hald-addon-keyb
2830 ? 00:00:01 hald-addon-stor
2842 ? 00:00:00 hald-addon-stor
2849 ? 00:00:00 dhcdbd
2856 ? 00:00:00 NetworkManager
2871 ? 00:00:00 avahi-daemon
2872 ? 00:00:00 avahi-daemon
2879 ? 00:00:00 NetworkManagerD
2889 ? 00:00:00 dirmngr
2941 ? 00:00:00 exim4
2968 ? 00:00:00 papd
2970 ? 00:00:00 afpd
2972 ? 00:00:00 cnid_metad
2995 ? 00:00:00 nfsd4
2996 ? 00:00:00 nfsd
2997 ? 00:00:00 nfsd
2998 ? 00:00:00 nfsd
2999 ? 00:00:00 nfsd
3000 ? 00:00:00 nfsd
3001 ? 00:00:00 nfsd
3002 ? 00:00:00 nfsd
3003 ? 00:00:00 nfsd
3004 ? 00:00:00 lockd
3005 ? 00:00:00 rpciod/0
3009 ? 00:00:00 rpc.mountd
3019 ? 00:00:00 inetd
3026 ? 00:00:00 nmbd
3028 ? 00:00:00 smbd
3038 ? 00:00:00 smbd
3039 ? 00:00:00 winbindd
3086 ? 00:00:00 winbindd
3095 ? 00:00:00 gdm
3096 ? 00:00:00 gdm
3104 tty7 00:09:28 Xorg
3107 ? 00:00:00 rpc.statd
3120 ? 00:00:00 rpc.idmapd
3155 ? 00:00:00 hcid
3159 ? 00:00:00 sdpd
3171 ? 00:00:00 krfcommd
3240 ? 00:00:00 powersaved
3270 ? 00:00:00 atd
3277 ? 00:00:00 cron
3355 tty1 00:00:00 getty
3356 tty2 00:00:00 getty
3357 tty3 00:00:00 getty
3358 tty4 00:00:00 getty
3359 tty5 00:00:00 getty
3360 tty6 00:00:00 getty
3371 ? 00:00:01 gnome-session
3423 ? 00:00:00 ssh-agent
3426 ? 00:00:00 dbus-launch
3427 ? 00:00:00 dbus-daemon
3429 ? 00:00:00 gconfd-2
3432 ? 00:00:00 gnome-keyring-d
3434 ? 00:00:00 bonobo-activati
3436 ? 00:00:06 gnome-settings-
3439 ? 00:00:31 metacity
3455 ? 00:00:14 nautilus
3461 ? 00:00:00 vino-session
3462 ? 00:00:00 gnome-volume-ma
3468 ? 00:00:01 gnome-vfs-daemo
3484 ? 00:00:15 beagled
3488 ? 00:00:02 gnome-power-man
3501 ? 00:00:00 mapping-daemon
3518 ? 00:00:01 kbluetoothd.rea
3521 ? 00:00:06 gnome-screensav
3527 ? 00:00:14 gnome-panel
3529 ? 00:00:26 wnck-applet
3532 ? 00:00:02 mixer_applet2
3535 ? 00:00:00 notification-ar
3537 ? 00:00:01 clock-applet
3542 ? 00:00:00 passkey-agent
3545 ? 00:00:00 kdeinit
3548 ? 00:00:00 dcopserver
3550 ? 00:00:00 klauncher
3552 ? 00:00:04 kded
3556 ? 00:00:00 knotify
3560 ? 00:00:48 gksu
3565 pts/0 00:00:00 su
3568 pts/0 00:00:00 gksu-run-helper
3575 pts/0 00:00:10 gnome-terminal
3589 pts/0 00:00:00 gconfd-2
3591 ? 00:00:00 bonobo-activati
3592 pts/0 00:00:00 gnome-pty-helpe
3593 pts/1 00:00:00 bash
3619 ? 00:00:00 kdeinit
3623 ? 00:00:00 dcopserver
3625 ? 00:00:00 klauncher
3672 ? 00:00:06 knotify
3675 ? 00:00:02 artsd
3768 pts/1 00:00:07 kppp
3769 ? 00:00:00 kppp
3774 rfcomm0 00:00:00 pppd
3794 ? 00:12:36 firefox-bin
3931 ? 00:00:03 notification-da
3962 ? 00:00:00 winbindd
4248 ? 00:00:00 smbd
4395 ? 00:00:00 smbd
4680 pts/2 00:00:00 bash
4692 pts/2 00:00:00 man
4698 pts/2 00:00:00 pager
4717 pts/5 00:00:00 bash
4726 pts/5 00:00:00 ps
This ps -e displays all running processes on your system
3) VIT:/home/antony# ps -LF
UID PID PPID LWP C NLWP SZ RSS PSR STIME TTY TIME CMD
root 4717 3575 4717 0 1 991 1672 0 00:09 pts/5 00:00:00 bash
root 4731 4717 4731 0 1 857 992 0 00:13 pts/5 00:00:00 ps -LF
This ps -LF option displays the inforamtion about active process thread details on your system.
4) VIT:/home/antony# ps -ejH
PID PGID SID TTY TIME CMD
1 1 1 ? 00:00:01 init
2 1 1 ? 00:00:00 migration/0
3 1 1 ? 00:00:00 ksoftirqd/0
4 1 1 ? 00:00:00 events/0
5 1 1 ? 00:00:00 khelper
6 1 1 ? 00:00:00 kthread
9 1 1 ? 00:00:00 kblockd/0
10 1 1 ? 00:00:00 kacpid
102 1 1 ? 00:00:00 kseriod
142 1 1 ? 00:00:00 pdflush
143 1 1 ? 00:00:00 pdflush
144 1 1 ? 00:00:00 kswapd0
145 1 1 ? 00:00:00 aio/0
588 1 1 ? 00:00:00 ata/0
590 1 1 ? 00:00:00 ata_aux
591 1 1 ? 00:00:00 khubd
593 1 1 ? 00:00:00 scsi_eh_0
595 1 1 ? 00:00:00 scsi_eh_1
1066 1 1 ? 00:00:00 kjournald
1632 1 1 ? 00:00:00 kpsmoused
1650 1 1 ? 00:00:00 kgameportd
1956 1 1 ? 00:00:00 kmirrord
2009 1 1 ? 00:00:00 kjournald
2995 1 1 ? 00:00:00 nfsd4
3005 1 1 ? 00:00:00 rpciod/0
1247 1247 1247 ? 00:00:00 udevd
2340 2340 2340 ? 00:00:00 portmap
2592 2592 2592 ? 00:00:00 syslogd
2598 2598 2598 ? 00:00:00 klogd
2612 2612 2612 ? 00:00:00 named
2638 2638 2638 ? 00:00:00 lwresd
2662 2662 2662 ? 00:00:00 hpiod
2665 2664 2664 ? 00:00:00 python
2702 2698 2698 ? 00:00:00 postmaster
2705 2698 2698 ? 00:00:00 postmaster
2706 2698 2698 ? 00:00:00 postmaster
2707 2698 2698 ? 00:00:00 postmaster
2791 2791 2791 ? 00:00:00 acpid
2798 2798 2798 ? 00:00:00 dbus-daemon
2806 2806 2806 ? 00:00:03 hald
2807 2806 2806 ? 00:00:00 hald-runner
2813 2806 2806 ? 00:00:00 hald-addon-acpi
2817 2806 2806 ? 00:00:00 hald-addon-keyb
2830 2806 2806 ? 00:00:01 hald-addon-stor
2842 2806 2806 ? 00:00:00 hald-addon-stor
2849 2849 2849 ? 00:00:00 dhcdbd
2856 2856 2856 ? 00:00:00 NetworkManager
2871 2871 2871 ? 00:00:00 avahi-daemon
2872 2872 2872 ? 00:00:00 avahi-daemon
2879 2879 2879 ? 00:00:00 NetworkManagerD
2889 2889 2889 ? 00:00:00 dirmngr
2941 2941 2941 ? 00:00:00 exim4
2968 2561 2561 ? 00:00:00 papd
2970 2561 2561 ? 00:00:00 afpd
2972 2972 2561 ? 00:00:00 cnid_metad
2996 1 1 ? 00:00:00 nfsd
2997 1 1 ? 00:00:00 nfsd
2998 1 1 ? 00:00:00 nfsd
2999 1 1 ? 00:00:00 nfsd
3000 1 1 ? 00:00:00 nfsd
3001 1 1 ? 00:00:00 nfsd
3002 1 1 ? 00:00:00 nfsd
3003 1 1 ? 00:00:00 nfsd
3004 1 1 ? 00:00:00 lockd
3009 3009 3009 ? 00:00:00 rpc.mountd
3019 3019 3019 ? 00:00:00 inetd
3026 3026 3026 ? 00:00:00 nmbd
3028 3028 3028 ? 00:00:00 smbd
3038 3028 3028 ? 00:00:00 smbd
4248 3028 3028 ? 00:00:00 smbd
4395 3028 3028 ? 00:00:00 smbd
3039 3039 3039 ? 00:00:00 winbindd
3086 3039 3039 ? 00:00:00 winbindd
3962 3039 3039 ? 00:00:00 winbindd
3095 3095 3095 ? 00:00:00 gdm
3096 3096 3095 ? 00:00:00 gdm
3104 3104 3104 tty7 00:09:43 Xorg
3371 3371 3371 ? 00:00:01 gnome-session
3423 3423 3423 ? 00:00:00 ssh-agent
3107 3107 3107 ? 00:00:00 rpc.statd
3120 3120 3120 ? 00:00:00 rpc.idmapd
3155 3155 3155 ? 00:00:00 hcid
3159 3159 3159 ? 00:00:00 sdpd
3171 1 1 ? 00:00:00 krfcommd
3240 3239 3239 ? 00:00:00 powersaved
3270 3270 3270 ? 00:00:00 atd
3277 3277 3277 ? 00:00:00 cron
3355 3355 3355 tty1 00:00:00 getty
3356 3356 3356 tty2 00:00:00 getty
3357 3357 3357 tty3 00:00:00 getty
3358 3358 3358 tty4 00:00:00 getty
3359 3359 3359 tty5 00:00:00 getty
3360 3360 3360 tty6 00:00:00 getty
3426 3371 3371 ? 00:00:00 dbus-launch
3427 3427 3427 ? 00:00:00 dbus-daemon
3429 3371 3371 ? 00:00:00 gconfd-2
3432 3371 3371 ? 00:00:00 gnome-keyring-d
3434 3434 3434 ? 00:00:00 bonobo-activati
3436 3434 3434 ? 00:00:06 gnome-settings-
3439 3439 3439 ? 00:00:32 metacity
3455 3455 3455 ? 00:00:14 nautilus
3461 3461 3461 ? 00:00:00 vino-session
3462 3462 3462 ? 00:00:00 gnome-volume-ma
3468 3434 3434 ? 00:00:01 gnome-vfs-daemo
3484 3481 3481 ? 00:00:15 beagled
3488 3488 3488 ? 00:00:02 gnome-power-man
3501 3455 3455 ? 00:00:00 mapping-daemon
3518 3453 3453 ? 00:00:01 kbluetoothd.rea
3521 3521 3521 ? 00:00:06 gnome-screensav
3527 3527 3527 ? 00:00:14 gnome-panel
3529 3434 3434 ? 00:00:26 wnck-applet
3532 3434 3434 ? 00:00:02 mixer_applet2
3535 3434 3434 ? 00:00:01 notification-ar
3537 3434 3434 ? 00:00:01 clock-applet
3542 3527 3527 ? 00:00:00 passkey-agent
3545 3545 3545 ? 00:00:00 kdeinit
3550 3545 3545 ? 00:00:00 klauncher
3548 3545 3545 ? 00:00:00 dcopserver
3552 3545 3545 ? 00:00:04 kded
3556 3545 3545 ? 00:00:00 knotify
3560 3455 3455 ? 00:00:50 gksu
3565 3565 3565 pts/0 00:00:00 su
3568 3565 3565 pts/0 00:00:00 gksu-run-helper
3575 3565 3565 pts/0 00:00:12 gnome-terminal
3592 3565 3565 pts/0 00:00:00 gnome-pty-helpe
3593 3593 3593 pts/1 00:00:00 bash
3768 3768 3593 pts/1 00:00:07 kppp
3769 3769 3769 ? 00:00:00 kppp
3774 3774 3774 rfcomm0 00:00:00 pppd
4680 4680 4680 pts/2 00:00:00 bash
4692 4692 4680 pts/2 00:00:00 man
4698 4692 4680 pts/2 00:00:00 pager
4717 4717 4717 pts/5 00:00:00 bash
4736 4736 4717 pts/5 00:00:00 ps
3589 3565 3565 pts/0 00:00:00 gconfd-2
3591 3591 3591 ? 00:00:00 bonobo-activati
3619 3619 3619 ? 00:00:00 kdeinit
3625 3619 3619 ? 00:00:00 klauncher
3623 3619 3619 ? 00:00:00 dcopserver
3672 3619 3619 ? 00:00:06 knotify
3675 3619 3619 ? 00:00:02 artsd
3794 3527 3527 ? 00:12:56 firefox-bin
3931 3427 3427 ? 00:00:03 notification-da
This ps -eJF option displays the process tree of all running processes
Recent Comments