==== ps_pstree ====
user@host ~ $ ps PID TTY TIME CMD 741 pts/5 00:00:00 ash 742 pts/5 00:00:00 ps user@host ~ $ ps -e PID TTY TIME CMD 1 ? 00:00:00 init 270 ? 00:00:00 syslogd 298 ? 00:00:00 crond 401 ? 00:00:00 udhcpc 444 pts/0 00:00:00 getty 445 pts/1 00:00:00 login 633 ? 00:00:00 sshd 659 pts/1 00:00:00 ash 697 pts/1 00:00:00 perl 723 pts/1 00:00:00 top 738 ? 00:00:00 sshd-session 740 ? 00:00:00 sshd-session 741 pts/5 00:00:00 ash 743 pts/5 00:00:00 ps user@host ~ $ ps -el F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 4 S 0 1 0 0 80 0 - 406 - ? 00:00:00 init 4 S 0 270 1 0 80 0 - 410 - ? 00:00:00 syslogd 0 S 0 298 1 0 80 0 - 406 - ? 00:00:00 crond 5 S 0 401 1 0 80 0 - 406 - ? 00:00:00 udhcpc 0 S 0 444 1 0 80 0 - 406 - pts/0 00:00:00 getty 0 S 0 445 1 0 80 0 - 406 - pts/1 00:00:00 login 5 S 0 633 1 0 80 0 - 1543 - ? 00:00:00 sshd 4 S 1000 659 445 0 80 0 - 427 do_wai pts/1 00:00:00 ash 0 S 1000 697 659 0 80 0 - 1605 futex_ pts/1 00:00:00 perl 0 S 1000 723 659 0 80 0 - 927 do_sel pts/1 00:00:00 top 4 S 0 738 633 0 80 0 - 1659 - ? 00:00:00 sshd-session 5 S 1000 740 738 0 80 0 - 1734 - ? 00:00:00 sshd-session 0 S 1000 741 740 0 80 0 - 427 do_wai pts/5 00:00:00 ash 0 R 1000 744 741 0 80 0 - 639 - pts/5 00:00:00 ps user@host ~ $ ps -ef UID PID PPID C STIME TTY TIME CMD root 1 0 0 21:13 ? 00:00:00 /sbin/init root 270 1 0 21:13 ? 00:00:00 /sbin/syslogd -t -n root 298 1 0 21:13 ? 00:00:00 /usr/sbin/crond -c /etc/crontabs -f root 401 1 0 21:13 ? 00:00:00 /sbin/udhcpc -b -R -p /var/run/udhcpc.eth0.pid -i eth0 -x hostname:temp root 444 1 0 21:13 pts/0 00:00:00 /sbin/getty 38400 console root 445 1 0 21:13 pts/1 00:00:00 /bin/login -- user root 633 1 0 21:17 ? 00:00:00 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups user 659 445 0 21:19 pts/1 00:00:00 -ash user 697 659 0 21:32 pts/1 00:00:00 perl ./myScript.pl user 723 659 0 21:36 pts/1 00:00:00 top root 738 633 0 21:38 ? 00:00:00 sshd-session: user [priv] user 740 738 0 21:39 ? 00:00:00 sshd-session: user@pts/5 user 741 740 0 21:39 pts/5 00:00:00 -ash user 745 741 0 21:39 pts/5 00:00:00 ps -ef user@host ~ $ ps -Tef UID PID SPID PPID C STIME TTY TIME CMD root 1 1 0 0 21:13 ? 00:00:00 /sbin/init root 270 270 1 0 21:13 ? 00:00:00 /sbin/syslogd -t -n root 298 298 1 0 21:13 ? 00:00:00 /usr/sbin/crond -c /etc/crontabs -f root 401 401 1 0 21:13 ? 00:00:00 /sbin/udhcpc -b -R -p /var/run/udhcpc.eth0.pid -i eth0 -x hostname:temp root 444 444 1 0 21:13 pts/0 00:00:00 /sbin/getty 38400 console root 445 445 1 0 21:13 pts/1 00:00:00 /bin/login -- user root 633 633 1 0 21:17 ? 00:00:00 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups user 659 659 445 0 21:19 pts/1 00:00:00 -ash user 697 697 659 0 21:32 pts/1 00:00:00 perl ./myScript.pl user 697 698 659 0 21:32 pts/1 00:00:00 perl ./myScript.pl user 723 723 659 0 21:36 pts/1 00:00:00 top root 738 738 633 0 21:38 ? 00:00:00 sshd-session: user [priv] user 740 740 738 0 21:39 ? 00:00:00 sshd-session: user@pts/5 user 741 741 740 0 21:39 pts/5 00:00:00 -ash user 746 746 741 0 21:39 pts/5 00:00:00 ps -Tef user@host ~ $ ps -Hef UID PID PPID C STIME TTY TIME CMD root 1 0 0 21:13 ? 00:00:00 /sbin/init root 270 1 0 21:13 ? 00:00:00 /sbin/syslogd -t -n root 298 1 0 21:13 ? 00:00:00 /usr/sbin/crond -c /etc/crontabs -f root 401 1 0 21:13 ? 00:00:00 /sbin/udhcpc -b -R -p /var/run/udhcpc.eth0.pid -i eth0 -x hostname:temp root 444 1 0 21:13 pts/0 00:00:00 /sbin/getty 38400 console root 445 1 0 21:13 pts/1 00:00:00 /bin/login -- user user 659 445 0 21:19 pts/1 00:00:00 -ash user 697 659 0 21:32 pts/1 00:00:00 perl ./myScript.pl user 723 659 0 21:36 pts/1 00:00:00 top root 633 1 0 21:17 ? 00:00:00 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups root 738 633 0 21:38 ? 00:00:00 sshd-session: user [priv] user 740 738 0 21:39 ? 00:00:00 sshd-session: user@pts/5 user 741 740 0 21:39 pts/5 00:00:00 -ash user 747 741 0 21:39 pts/5 00:00:00 ps -Hef user@host ~ $ pstree init─┬─crond ├─getty ├─login───ash─┬─perl───{perl} │ └─top ├─sshd───sshd-session───sshd-session───ash───pstree ├─syslogd └─udhcpc user@host ~ $ pstree -hup init(1)─┬─crond(298) ├─getty(444) ├─login(445)───ash(659,user)─┬─perl(697)───{perl}(698) │ └─top(723) ├─sshd(633)───sshd-session(738)───sshd-session(740,user)───ash(741)───pstree(750) ├─syslogd(270) └─udhcpc(401) user@host ~ $ pstree -a init ├─crond -c /etc/crontabs -f ├─getty 38400 console ├─login -- user │ └─ash │ ├─perl ./myScript.pl │ │ └─{perl} │ └─top ├─sshd │ └─sshd-session │ └─sshd-session │ └─ash │ └─pstree -a ├─syslogd -t -n └─udhcpc -b -R -p /var/run/udhcpc.eth0.pid -i eth0 -x hostname:temp==== zombie ====
user@host ~ $ ps -t tty1 PID TTY TIME CMD 445 pts/1 00:00:00 login 659 pts/1 00:00:00 ash 798 pts/1 00:00:00 perl 799 pts/1 00:00:00 fortune user@host ~ $ ps -l -t tty1 F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 S 0 445 1 0 80 0 - 406 - pts/1 00:00:00 login 4 S 1000 659 445 0 80 0 - 427 do_wai pts/1 00:00:00 ash 0 S 1000 798 659 0 80 0 - 1244 hrtime pts/1 00:00:00 perl 0 Z 1000 799 798 0 80 0 - 0 - pts/1 00:00:00 fortune user@host ~ $ ps -f -t tty1 UID PID PPID C STIME TTY TIME CMD root 445 1 0 21:13 pts/1 00:00:00 /bin/login -- user user 659 445 0 21:19 pts/1 00:00:00 -ash user 798 659 0 21:49 pts/1 00:00:00 perl -e open(my $fh, "fortune -s|"); sleep 60*60; user 799 798 0 21:49 pts/1 00:00:00 [fortune] <defunct> user@host ~ $ ps -F -t tty1 UID PID PPID C SZ RSS PSR STIME TTY TIME CMD root 445 1 0 406 800 4 21:13 pts/1 00:00:00 /bin/login -- user user 659 445 0 427 1120 15 21:19 pts/1 00:00:00 -ash user 798 659 0 1244 2880 6 21:49 pts/1 00:00:00 perl -e open(my $fh, "fortune -s|"); sleep 60*60; user 799 798 0 0 0 17 21:49 pts/1 00:00:00 [fortune] <defunct> user@host ~ $ ps ut tty1 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 445 0.0 0.0 1624 800 pts/1 Ss 21:13 0:00 /bin/login -- user user 659 0.0 0.0 1708 1120 pts/1 S 21:19 0:00 -ash user 798 0.0 0.0 4976 2880 pts/1 S+ 21:49 0:00 perl -e open(my $fh, "fortune -s|"); sleep 60*60; user 799 0.0 0.0 0 0 pts/1 Z+ 21:49 0:00 [fortune] <defunct> user@host ~ $ pstree -a 659 ash └─perl -e open(my $fh, "fortune -s|"); sleep 60*60; └─(fortune)