Senin, 12 Januari 2015

PROSES DAN MANAJEMEN PROSES 2

12/01/2015


PERCOBAAN 4 (Menampilkan Status Proses dengan Berbagai Format)
1. Ketik ps –e | more dan tekan Enter. Opsi ­e menampilkan semua proses dalam bentuk 4
kolom : PID, TTY, TIME dan CMD.
$ ps –e | more

nur@nur-Satellite-L740:~$ ps -e | more
  PID TTY          TIME CMD
    1 ?        00:00:01 init
    2 ?        00:00:00 kthreadd
    3 ?        00:00:00 ksoftirqd/0
    4 ?        00:00:00 kworker/0:0
    5 ?        00:00:00 kworker/0:0H
    6 ?        00:00:00 kworker/u16:0
    7 ?        00:00:00 rcu_sched
    8 ?        00:00:00 rcu_bh
    9 ?        00:00:00 migration/0
   10 ?        00:00:00 watchdog/0
   11 ?        00:00:00 watchdog/1
   12 ?        00:00:00 migration/1
   13 ?        00:00:00 ksoftirqd/1
   14 ?        00:00:00 kworker/1:0
   15 ?        00:00:00 kworker/1:0H
   16 ?        00:00:00 watchdog/2
   17 ?        00:00:00 migration/2
   18 ?        00:00:00 ksoftirqd/2
   19 ?        00:00:00 kworker/2:0
   20 ?        00:00:00 kworker/2:0H
   21 ?        00:00:00 watchdog/3
   22 ?        00:00:00 migration/3

2. Ketik  ps   ax   |   more  dan   tekan  Enter.  Opsi   a   akan   menampilkan   semua   proses   yang
dihasilkan  terminal  (TTY).  Opsi  x  menampilkan  semua   proses  yang   tidak   dihasilkan
terminal. Secara logika opsi ini sama dengan opsi  –e.  Terdapa 5 kolom : PID, TTY,
STAT, TIME dan COMMAND.
$ ps ax | more


nur@nur-Satellite-L740:~$ ps ax | more
  PID TTY      STAT   TIME COMMAND
    1 ?        Ss     0:01 /sbin/init
    2 ?        S      0:00 [kthreadd]
    3 ?        S      0:00 [ksoftirqd/0]
    4 ?        S      0:00 [kworker/0:0]
    5 ?        S<     0:00 [kworker/0:0H]
    6 ?        S      0:00 [kworker/u16:0]
    7 ?        S      0:00 [rcu_sched]
    8 ?        S      0:00 [rcu_bh]
    9 ?        S      0:00 [migration/0]
   10 ?        S      0:00 [watchdog/0]
   11 ?        S      0:00 [watchdog/1]
   12 ?        S      0:00 [migration/1]
   13 ?        S      0:00 [ksoftirqd/1]
   14 ?        S      0:00 [kworker/1:0]
   15 ?        S<     0:00 [kworker/1:0H]
   16 ?        S      0:00 [watchdog/2]
   17 ?        S      0:00 [migration/2]
   18 ?        S      0:00 [ksoftirqd/2]
   19 ?        S      0:00 [kworker/2:0]
   20 ?        S<     0:00 [kworker/2:0H]
   21 ?        S      0:00 [watchdog/3]
   22 ?        S      0:00 [migration/3]
--More--

3. Ketik ps –e f | more dan tekan Enter. Opsi –e f akan menampilkan semua proses dalam
format daftar penuh.
$ ps ef | more


nur@nur-Satellite-L740:~$ ps ef | more
  PID TTY      STAT   TIME COMMAND
 2169 pts/0    Ss     0:00 bash SESSION_MANAGER=local/nur-Satellite-L740:@/tmp/.
ICE-unix/1547,unix/nur-Satellite-L740:/tmp/.ICE-unix/1547 XDG_SESSION_ID=c2 LC_I
DENTIFICATION=id_ID.UTF-8 XDG_SEAT=seat0 DISPLAY=:0 JOB=dbus COLORTERM=gnome-ter
minal GNOME_KEYRING_CONTROL=/run/user/1000/keyring-TFlB1L GNOME_DESKTOP_SESSION_
ID=this-is-deprecated DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path QT_QPA_
PLATFORMTHEME=appmenu-qt5 LOGNAME=nur TEXTDOMAIN=im-config INSTANCE= LC_TIME=id_
ID.UTF-8 SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:
/sbin:/bin:/usr/games:/usr/local/games LC_NUMERIC=id_ID.UTF-8 LC_PAPER=id_ID.UTF
-8 IM_CONFIG_PHASE=1 QT4_IM_MODULE=xim CLUTTER_IM_MODULE=xim TEXTDOMAINDIR=/usr/
share/locale/ XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0 SESSION=
ubuntu SSH_AUTH_SOCK=/run/user/1000/keyring-TFlB1L/ssh XDG_MENU_PREFIX=gnome- XA
UTHORITY=/home/nur/.Xauthority GDMSESSION=ubuntu XMODIFIERS=@im=ibus LC_ADDRESS=
id_ID.UTF-8 LC_MEASUREMENT=id_ID.UTF-8 XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/
share/upstart/xdg:/etc/xdg MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
 UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/1424 DESKTOP_SES
SION=ubuntu XDG_RUNTIME_DIR=/run/user/1000 GTK_IM_MODULE=ibus GTK_MODULES=overla
y-scrollbar:unity-gtk-module USER=nur PWD=/home/nur VTE_VERSION=3409 LC_MONETARY
=id_ID.UTF-8 HOME=/home/nur XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
SSH_AGENT_PID=1493 XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/s
hare/:/usr/share/ LANGUAGE=en_US SELINUX_INIT=YES COMPIZ_CONFIG_PROFILE=ubuntu X
DG_GREETER_DATA_DIR=/var/lib/lightdm-data/nur COMPIZ_BIN_PATH=/usr/bin/ LC_NAME=
id_ID.UTF-8 LANG=en_US.UTF-8 GPG_AGENT_INFO=/run/user/1000/keyring-TFlB1L/gpg:0:
--More--

4. Ketik ps –eo pid, cmd | more dan tekan Enter. Opsi –eo akan menampilkan semua proses
dalam format sesuai definisi user yaitu terdiri dari kolom PID dan CMD.
$ ps –eo pid,cmd | more


 nur@nur-Satellite-L740:~$ ps -eo pid,cmd | more
  PID CMD
    1 /sbin/init
    2 [kthreadd]
    3 [ksoftirqd/0]
    5 [kworker/0:0H]
    6 [kworker/u16:0]
    7 [rcu_sched]
    8 [rcu_bh]
    9 [migration/0]
   10 [watchdog/0]
   11 [watchdog/1]
   12 [migration/1]
   13 [ksoftirqd/1]
   14 [kworker/1:0]
   15 [kworker/1:0H]
   16 [watchdog/2]
   17 [migration/2]
   18 [ksoftirqd/2]
   19 [kworker/2:0]
   20 [kworker/2:0H]
   21 [watchdog/3]
   22 [migration/3]
   23 [ksoftirqd/3]
--More--

5. Ketik  ps –eo pid,ppid,%mem,cmd | more  dan tekan  Enter.  Akan menampilkan kolom
PID, PPID dan %MEM. PPID adalah proses ID dari proses parent. %MEM menampilkan
persentasi   memory   system   yang   digunakan   proses.   Jika   proses   hanya   menggunakan
sedikit memory system akan ditampilkan 0.
$ ps –eo pid,ppid,%mem,cmd | more


 nur@nur-Satellite-L740:~$ ps -eo pid,ppid,%mem,cmd | more
  PID  PPID %MEM CMD
    1     0  0.1 /sbin/init
    2     0  0.0 [kthreadd]
    3     2  0.0 [ksoftirqd/0]
    5     2  0.0 [kworker/0:0H]
    7     2  0.0 [rcu_sched]
    8     2  0.0 [rcu_bh]
    9     2  0.0 [migration/0]
   10     2  0.0 [watchdog/0]
   11     2  0.0 [watchdog/1]
   12     2  0.0 [migration/1]
   13     2  0.0 [ksoftirqd/1]
   14     2  0.0 [kworker/1:0]
   15     2  0.0 [kworker/1:0H]
   16     2  0.0 [watchdog/2]
   17     2  0.0 [migration/2]
   18     2  0.0 [ksoftirqd/2]
   19     2  0.0 [kworker/2:0]
   20     2  0.0 [kworker/2:0H]
   21     2  0.0 [watchdog/3]
   22     2  0.0 [migration/3]
   23     2  0.0 [ksoftirqd/3]
   25     2  0.0 [kworker/3:0H]
--More--

PERCOBAAN 5 (Mengontrol proses pada shell)

1. Gunakan perintah yes yang mengirim output y yang tidak pernah berhenti
$ yes


y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y

^Cnur@nur-Satellite-L740:~$

2. Belokkan standart output ke /dev/null
$ yes > /dev/null


nur@nur-Satellite-L740:~$ yes > /dev/null
^C
3. Salah satu cara agar perintah yes tetap dijalankan tetapi shell tetap digunakan untuk hal
yang lain dengan meletakkan proses pada background dengan menambahkan karakter &
pada akhir perintah.
$ yes > /dev/null & 

nur@nur-Satellite-L740:~$ yes > /dev/null &
[1] 2424

4. Untuk melihat status proses gunakan perintah jobs.
$ jobs


nur@nur-Satellite-L740:~$ jobs
[1]+  Running                 yes > /dev/null &

5. Untuk   menghentikan  job,   gunakan   perintah  kill  diikuti   job   number   atau   PID   proses.
Untuk identifikasi job number, diikuti prefix dengan karakter ”%”.
$ kill %<nomor job> contoh : kill %1

nur@nur-Satellite-L740:~$ kill %<nomor job> contoh : kill % 1
bash: nomor: No such file or directory

6. Lihat status job setelah diterminasi
$ jobs

nur@nur-Satellite-L740:~$ jobs
[1]+  Running                 yes > /dev/null &


PERCOBAAN 6 (Menghentikan dan memulai kembali job)

1. Cara lain meletakkan  job pada  background  dengan memulai  job secara normal  (pada
foreground), stop job dan memulai lagi pada background
$ yes > /dev/null

nur@nur-Satellite-L740:~$ yes > /dev/null
^Z
[2]+  Stopped                 yes > /dev/null


2. Untuk restart job pada foreground , gunakan perintah fg.
$ fg

nur@nur-Satellite-L740:~$ fg
yes > /dev/null
^Z
[2]+  Stopped                 yes > /dev/null

3. Shell akan menampilkan  nama perintah  yang diletakkan  di  foreground.  Stop  job  lagi
dengan Ctrl­Z. Kemudian gunakan perintah bg untuk meletakkan job pada background.
$ bg

nur@nur-Satellite-L740:~$ bg
[2]+ yes > /dev/null &

Job   tidak   bisa   dihentikan   dengan  Ctrl­Z  karena   job   berada   pada  background.  Untuk
menghentikannya,   letakkan   job   pada  foreground  dengan  fg  dan   kemudian   hentikan
sementara dengan Ctrl­Z.
$ fg

nur@nur-Satellite-L740:~$ fg
yes > /dev/null
^Z
[2]+  Stopped                 yes > /dev/null


4.

5. Apabila ingin menjalankan banyak job dalam satu waktu, letakkan job pada foreground
atau background dengan memberikan job ID
$ fg %2 atau $ %2 
$ bg %2

nur@nur-Satellite-L740:~$ fg %2
yes > /dev/null
^Z
[2]+  Stopped                 yes > /dev/null
nur@nur-Satellite-L740:~$ bg %2
[2]+ yes > /dev/null &
nur@nur-Satellite-L740:~$ bg %2
bash: bg: job 2 already in background

6. ketik  fg  dan tekan  Enter,  kemudian  dilanjutkan  dengan  Ctrl ­Z  untuk menghentikan
sementara.

nur@nur-Satellite-L740:~$ fg
yes > /dev/null
^Z
[2]+  Stopped                 yes > /dev/null

7. Lihat job dengan perintah  ps ­fae  dan tekan  Enter.  Kemudian hentikan proses dengan
perintah kill.

nur@nur-Satellite-L740:~$ ps -fae
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 16:21 ?        00:00:01 /sbin/init
root         2     0  0 16:21 ?        00:00:00 [kthreadd]
root         3     2  0 16:21 ?        00:00:00 [ksoftirqd/0]
root         5     2  0 16:21 ?        00:00:00 [kworker/0:0H]
root         7     2  0 16:21 ?        00:00:00 [rcu_sched]
root         8     2  0 16:21 ?        00:00:00 [rcu_bh]
root         9     2  0 16:21 ?        00:00:00 [migration/0]
root        10     2  0 16:21 ?        00:00:00 [watchdog/0]
root        11     2  0 16:21 ?        00:00:00 [watchdog/1]
root        12     2  0 16:21 ?        00:00:00 [migration/1]
root        13     2  0 16:21 ?        00:00:00 [ksoftirqd/1]
root        14     2  0 16:21 ?        00:00:00 [kworker/1:0]
root        15     2  0 16:21 ?        00:00:00 [kworker/1:0H]
root        16     2  0 16:21 ?        00:00:00 [watchdog/2]
root        17     2  0 16:21 ?        00:00:00 [migration/2]
root        18     2  0 16:21 ?        00:00:00 [ksoftirqd/2]
root        20     2  0 16:21 ?        00:00:00 [kworker/2:0H]
root        21     2  0 16:21 ?        00:00:00 [watchdog/3]
root        22     2  0 16:21 ?        00:00:00 [migration/3]
root        23     2  0 16:21 ?        00:00:00 [ksoftirqd/3]
root        25     2  0 16:21 ?        00:00:00 [kworker/3:0H]
root        26     2  0 16:21 ?        00:00:00 [khelper]
root        27     2  0 16:21 ?        00:00:00 [kdevtmpfs]
root        28     2  0 16:21 ?        00:00:00 [netns]
root        29     2  0 16:21 ?        00:00:00 [writeback]
root        30     2  0 16:21 ?        00:00:00 [kintegrityd]
root        31     2  0 16:21 ?        00:00:00 [bioset]
root        33     2  0 16:21 ?        00:00:00 [kblockd]
root        34     2  0 16:21 ?        00:00:00 [ata_sff]
root        35     2  0 16:21 ?        00:00:00 [khubd]
root        36     2  0 16:21 ?        00:00:00 [md]
root        37     2  0 16:21 ?        00:00:00 [devfreq_wq]
root        41     2  0 16:21 ?        00:00:00 [khungtaskd]
root        42     2  0 16:21 ?        00:00:00 [kswapd0]
root        43     2  0 16:21 ?        00:00:00 [ksmd]
root        44     2  0 16:21 ?        00:00:00 [khugepaged]
root        45     2  0 16:21 ?        00:00:00 [fsnotify_mark]
root        46     2  0 16:21 ?        00:00:00 [ecryptfs-kthrea]
root        47     2  0 16:21 ?        00:00:00 [crypto]
root        59     2  0 16:21 ?        00:00:00 [kthrotld]
root        63     2  0 16:21 ?        00:00:06 [kworker/3:1]
root        82     2  0 16:21 ?        00:00:00 [deferwq]
root        83     2  0 16:21 ?        00:00:00 [charger_manager]
root       131     2  0 16:21 ?        00:00:03 [kworker/2:1]
root       136     2  0 16:21 ?        00:00:03 [kworker/1:1]
root       137     2  0 16:21 ?        00:00:00 [scsi_eh_0]
root       138     2  0 16:21 ?        00:00:00 [scsi_eh_1]
root       139     2  0 16:21 ?        00:00:00 [scsi_eh_2]
root       140     2  0 16:21 ?        00:00:00 [scsi_eh_3]
root       141     2  0 16:21 ?        00:00:00 [scsi_eh_4]
root       159     2  0 16:21 ?        00:00:00 [jbd2/sda6-8]
root       160     2  0 16:21 ?        00:00:00 [ext4-rsv-conver]
root       284     1  0 16:21 ?        00:00:00 upstart-udev-bridge --daemon
root       290     1  0 16:21 ?        00:00:00 /lib/systemd/systemd-udevd --dae
root       361     2  0 16:21 ?        00:00:00 [kworker/u17:1]
root       362     2  0 16:21 ?        00:00:00 [irq/41-mei_me]
root       368     2  0 16:21 ?        00:00:00 [ips-adjust]
root       369     2  0 16:21 ?        00:00:00 [ips-monitor]
root       370     2  0 16:21 ?        00:00:00 [cfg80211]
root       377     2  0 16:21 ?        00:00:00 [kpsmoused]
root       389     2  0 16:21 ?        00:00:00 [kvm-irqfd-clean]
root       479     2  0 16:21 ?        00:00:00 [hd-audio0]
root       540     1  0 16:21 ?        00:00:00 upstart-socket-bridge --daemon
root       547     2  0 16:21 ?        00:00:00 [hci0]
root       548     2  0 16:21 ?        00:00:00 [hci0]
root       549     2  0 16:21 ?        00:00:00 [kworker/u17:2]
root       568     2  0 16:21 ?        00:00:00 [jbd2/sda5-8]
root       569     2  0 16:21 ?        00:00:00 [ext4-rsv-conver]
root       577     2  0 16:21 ?        00:00:00 [jbd2/sda8-8]
root       578     2  0 16:21 ?        00:00:00 [ext4-rsv-conver]
message+   609     1  0 16:21 ?        00:00:00 dbus-daemon --system --fork
root       634     1  0 16:21 ?        00:00:00 /usr/sbin/ModemManager
syslog     635     1  0 16:21 ?        00:00:00 rsyslogd
root       656     1  0 16:21 ?        00:00:00 upstart-file-bridge --daemon
root       663     1  0 16:21 ?        00:00:00 /lib/systemd/systemd-logind
root       670     1  0 16:21 ?        00:00:00 /usr/sbin/bluetoothd
root       680     2  0 16:21 ?        00:00:00 [krfcommd]
avahi      729     1  0 16:21 ?        00:00:00 avahi-daemon: running [nur-Satel
avahi      730   729  0 16:21 ?        00:00:00 avahi-daemon: chroot helper
root       780     1  0 16:21 ?        00:00:00 NetworkManager
root       838     1  0 16:21 ?        00:00:00 /usr/lib/policykit-1/polkitd --n
root       855     1  0 16:21 tty4     00:00:00 /sbin/getty -8 38400 tty4
root       859     1  0 16:21 tty5     00:00:00 /sbin/getty -8 38400 tty5
root       866     1  0 16:21 tty2     00:00:00 /sbin/getty -8 38400 tty2
root       867     1  0 16:21 tty3     00:00:00 /sbin/getty -8 38400 tty3
root       870     1  0 16:21 tty6     00:00:00 /sbin/getty -8 38400 tty6
root       882     1  0 16:21 ?        00:00:00 /sbin/wpa_supplicant -B -P /run/
root       931     1  0 16:21 ?        00:00:00 lightdm
root       946     1  0 16:21 ?        00:00:00 acpid -c /etc/acpi/events -s /va
root       949     1  0 16:21 ?        00:00:00 /usr/sbin/cups-browsed
kernoops   952     1  0 16:21 ?        00:00:00 /usr/sbin/kerneloops
root       959     1  0 16:21 ?        00:00:00 /usr/sbin/irqbalance
root       961     1  0 16:21 ?        00:00:00 cron
root       973   931  1 16:21 tty7     00:00:49 /usr/bin/X -core :0 -seat seat0
root      1010     1  0 16:21 ?        00:00:00 /usr/lib/accountsservice/account
root      1029     1  0 16:21 tty1     00:00:00 /sbin/getty -8 38400 tty1
whoopsie  1054     1  0 16:21 ?        00:00:00 whoopsie
root      1064     2  0 16:21 ?        00:00:00 [kauditd]
root      1116   931  0 16:21 ?        00:00:00 lightdm --session-child 12 19
root      1162     1  0 16:21 ?        00:00:00 /usr/lib/upower/upowerd
rtkit     1186     1  0 16:21 ?        00:00:00 /usr/lib/rtkit/rtkit-daemon
nur       1419     1  0 16:22 ?        00:00:00 /usr/bin/gnome-keyring-daemon --
nur       1424  1116  0 16:22 ?        00:00:00 init --user
nur       1493  1424  0 16:22 ?        00:00:00 ssh-agent
nur       1497  1424  0 16:22 ?        00:00:01 dbus-daemon --fork --session --a
nur       1505  1424  0 16:22 ?        00:00:00 upstart-event-bridge
nur       1511  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/hud/wind
nur       1519  1424  0 16:22 ?        00:00:00 upstart-file-bridge --daemon --u
nur       1521  1424  0 16:22 ?        00:00:00 upstart-dbus-bridge --daemon --s
nur       1523  1424  0 16:22 ?        00:00:00 upstart-dbus-bridge --daemon --s
nur       1525  1424  0 16:22 ?        00:00:05 /usr/bin/ibus-daemon --daemonize
nur       1539  1424  0 16:22 ?        00:00:00 /usr/lib/unity-settings-daemon/u
nur       1543  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/hud/hud-
nur       1546  1424  0 16:22 ?        00:00:00 /usr/lib/at-spi2-core/at-spi-bus
nur       1547  1424  0 16:22 ?        00:00:00 gnome-session --session=ubuntu
nur       1549  1424  0 16:22 ?        00:00:02 /usr/lib/unity/unity-panel-servi
nur       1553  1546  0 16:22 ?        00:00:00 /bin/dbus-daemon --config-file=/
nur       1558  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfsd
nur       1562  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfsd-fuse /run/us
nur       1565  1525  0 16:22 ?        00:00:00 /usr/lib/ibus/ibus-dconf
nur       1567  1525  0 16:22 ?        00:00:01 /usr/lib/ibus/ibus-ui-gtk3
nur       1572  1424  0 16:22 ?        00:00:00 /usr/lib/ibus/ibus-x11 --kill-da
nur       1581  1424  0 16:22 ?        00:00:00 /usr/lib/at-spi2-core/at-spi2-re
nur       1613  1424  0 16:22 ?        00:00:01 /usr/lib/i386-linux-gnu/bamf/bam
nur       1614  1525  0 16:22 ?        00:00:01 /usr/lib/ibus/ibus-engine-simple
nur       1626  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1628  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1630  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1634  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1635  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1637  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1639  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1643  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
nur       1661  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/indicato
colord    1665     1  0 16:22 ?        00:00:00 /usr/lib/colord/colord
nur       1675  1539  0 16:22 ?        00:00:01 syndaemon -i 1.0 -t -K -R
nur       1688  1424  0 16:22 ?        00:00:00 /usr/lib/dconf/dconf-service
nur       1699  1424  0 16:22 ?        00:00:00 /usr/bin/pulseaudio --start --lo
nur       1707  1424  0 16:22 ?        00:00:00 /usr/lib/evolution/evolution-sou
nur       1737  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/notify-o
nur       1743  1547  1 16:22 ?        00:00:48 compiz
nur       1813  1547  0 16:22 ?        00:00:01 nautilus -n
nur       1815  1547  0 16:22 ?        00:00:00 /usr/lib/unity-settings-daemon/u
nur       1816  1547  0 16:22 ?        00:00:00 /usr/lib/policykit-1-gnome/polki
nur       1820  1547  0 16:22 ?        00:00:00 nm-applet
nur       1838  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfs-udisks2-volum
nur       1842  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/gconf/gc
nur       1848  1424  0 16:22 ?        00:00:00 /usr/lib/evolution/evolution-cal
root      1851     1  0 16:22 ?        00:00:00 /usr/lib/udisks2/udisksd --no-de
nur       1864  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfs-gphoto2-volum
nur       1870  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfs-afc-volume-mo
nur       1875  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfs-mtp-volume-mo
nur       1898  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfsd-trash --spaw
nur       1922  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfsd-burn --spawn
nur       1982  1547  0 16:22 ?        00:00:00 telepathy-indicator
nur       1988  1424  0 16:22 ?        00:00:00 /usr/lib/telepathy/mission-contr
nur       2002  1547  0 16:22 ?        00:00:00 zeitgeist-datahub
nur       2007  1424  0 16:22 ?        00:00:00 /usr/bin/zeitgeist-daemon
nur       2013  1424  0 16:22 ?        00:00:00 /usr/lib/i386-linux-gnu/zeitgeis
nur       2030  2013  0 16:22 ?        00:00:00 /bin/cat
nur       2034  1424  1 16:22 ?        00:00:45 evince /home/nur/Documents/5.pdf
nur       2042  1424  0 16:22 ?        00:00:00 /usr/lib/evince/evinced
nur       2049  1424  0 16:22 ?        00:00:00 /usr/lib/gvfs/gvfsd-metadata
nur       2073  1547  0 16:23 ?        00:00:00 update-notifier
nur       2091  1424  0 16:23 ?        00:00:00 /usr/lib/i386-linux-gnu/unity-sc
nur       2103  1424  0 16:23 ?        00:00:00 /usr/bin/unity-scope-loader appl
nur       2107  1424  0 16:23 ?        00:00:00 /usr/lib/i386-linux-gnu/unity-le
nur       2135  1424  0 16:23 ?        00:00:00 /usr/lib/i386-linux-gnu/unity-le
nur       2160  1424  0 16:23 ?        00:00:22 gnome-terminal
nur       2168  2160  0 16:23 ?        00:00:00 gnome-pty-helper
nur       2169  2160  0 16:23 pts/0    00:00:00 bash
nur       2220  1424  0 16:24 ?        00:00:00 /usr/lib/libreoffice/program/oos
nur       2235  1547  0 16:24 ?        00:00:00 /usr/lib/i386-linux-gnu/deja-dup
nur       2247  2220  0 16:24 ?        00:00:23 /usr/lib/libreoffice/program/sof
nur       2424  2169 99 16:45 pts/0    00:42:51 yes
root      2618     1  0 16:57 ?        00:00:00 /usr/sbin/cupsd -f
root      2731     2  0 16:59 ?        00:00:00 [kworker/u16:2]
root      2745     2  0 17:00 ?        00:00:00 [kworker/3:0]
nur       2757  2169 29 17:01 pts/0    00:07:57 yes
root      2921     2  0 17:12 ?        00:00:00 [kworker/2:0]
root      2926     2  0 17:12 ?        00:00:00 [kworker/0:1]
root      2935     2  0 17:20 ?        00:00:00 [kworker/u16:0]
root      2952     2  0 17:22 ?        00:00:00 [kworker/0:2]
root      2961     2  0 17:25 ?        00:00:00 [kworker/u16:1]
root      2975     2  0 17:27 ?        00:00:00 [kworker/0:0]
nur       2977  2169  0 17:28 pts/0    00:00:00 ps -fae


nur@nur-Satellite-L740:~$ kill -1
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

LATIHAN 

1. Masuk ke terminal Ketik ps –au dan tekan Enter. Kemudian perhatikan keluaran sebagai
berikut :

nur@nur-Satellite-L740:~$ ps -au
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root       855  0.0  0.0   4648   860 tty4     Ss+  16:21   0:00 /sbin/getty -8
root       859  0.0  0.0   4648   860 tty5     Ss+  16:21   0:00 /sbin/getty -8
root       866  0.0  0.0   4648   856 tty2     Ss+  16:21   0:00 /sbin/getty -8
root       867  0.0  0.0   4648   856 tty3     Ss+  16:21   0:00 /sbin/getty -8
root       870  0.0  0.0   4648   860 tty6     Ss+  16:21   0:00 /sbin/getty -8
root       973  1.2  1.9 151152 37796 tty7     Ssl+ 16:21   0:50 /usr/bin/X -cor
root      1029  0.0  0.0   4648   856 tty1     Ss+  16:21   0:00 /sbin/getty -8
nur       2169  0.0  0.1   6836  3164 pts/0    Ss   16:23   0:00 bash
nur       2424 99.9  0.0   4236   536 pts/0    R    16:45  46:52 yes
nur       2757 25.7  0.0   4236   540 pts/0    T    17:01   7:57 yes
nur       2990  0.0  0.0   5228  1160 pts/0    R+   17:32   0:00 ps -au

a. Sebutkan nama­nama proses yang bukan root

nur       2169  0.0  0.1   6836  3164 pts/0    Ss   16:23   0:00 bash
nur       2424 99.9  0.0   4236   536 pts/0    R    16:45  46:52 yes
nur       2757 25.7  0.0   4236   540 pts/0    T    17:01   7:57 yes
nur       2990  0.0  0.0   5228  1160 pts/0    R+   17:32   0:00 ps -au

b. Tulis PID dan COMMAND dari proses yang paling banyak menggunakan CPU time

nur       2424 99.9  0.0   4236   536 pts/0    R    16:45  46:52 yes

c. Sebutkan buyut proses dan PID dari proses tersebut

d. Sebutkan beberapa proses daemon

e. Pada prompt login lakukan hal - hal sebagai berikut :
$ csh 

nur@nur-Satellite-L740:~$ csh
The program 'csh' can be found in the following packages:
 * csh
 * tcsh
Try: sudo apt-get install <selected package>

$ who 

nur@nur-Satellite-L740:~$ bash
nur@nur-Satellite-L740:~$

$ bash 

nur@nur-Satellite-L740:~$ bash
nur@nur-Satellite-L740:~$

$ ls 

nur@nur-Satellite-L740:~$ ls
Desktop    Downloads  examples.desktop  Music     Public     Videos
Documents  ed by      johan             Pictures  Templates
$ sh 

nur@nur-Satellite-L740:~$ sh
$

$ ps 

nur@nur-Satellite-L740:~$ ps
  PID TTY          TIME CMD
 2169 pts/0    00:00:00 bash
 2424 pts/0    01:25:12 yes
 2757 pts/0    00:07:57 yes
 3419 pts/0    00:00:00 bash
 3441 pts/0    00:00:00 bash
 3465 pts/0    00:00:00 ps

f. Sebutkan PID yang paling besar dan kemudian buat urut-urutan proses sampai
ke PPID = 1.
 3465 pts/0    00:00:00 ps
 3441 pts/0    00:00:00 bash
 3419 pts/0    00:00:00 bash
 2757 pts/0    00:07:57 yes
 2424 pts/0    01:25:12 yes
 2169 pts/0    00:00:00 bash


2. Cobalah format tampilan ps dengan opsi berikut dan perhatikan hasil tampilannya :
 -f daftar penuh 

nur@nur-Satellite-L740:~$ ps -f
UID        PID  PPID  C STIME TTY          TIME CMD
nur       2169  2160  0 16:23 pts/0    00:00:00 bash
nur       2424  2169 99 16:45 pts/0    01:31:48 yes
nur       2757  2169 10 17:01 pts/0    00:07:57 yes
nur       3419  2169  0 18:08 pts/0    00:00:00 bash
nur       3441  3419  0 18:09 pts/0    00:00:00 bash
nur       3488  3441  0 18:17 pts/0    00:00:00 ps -f

 -j  format job 

nur@nur-Satellite-L740:~$ ps -j
  PID  PGID   SID TTY          TIME CMD
 2169  2169  2169 pts/0    00:00:00 bash
 2424  2424  2169 pts/0    01:31:56 yes
 2757  2757  2169 pts/0    00:07:57 yes
 3419  3419  2169 pts/0    00:00:00 bash
 3441  3441  2169 pts/0    00:00:00 bash
 3489  3489  2169 pts/0    00:00:00 ps

 J  format job control 

nur@nur-Satellite-L740:~$ ps j
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
 2160  2169  2169  2169 pts/0     3492 Ss    1000   0:00 bash
 2169  2424  2424  2169 pts/0     3492 R     1000  92:03 yes
 2169  2757  2757  2169 pts/0     3492 T     1000   7:57 yes
 2169  3419  3419  2169 pts/0     3492 S     1000   0:00 bash
 3419  3441  3441  2169 pts/0     3492 S     1000   0:00 bash
 3441  3492  3492  2169 pts/0     3492 R+    1000   0:00 ps j
 l daftar memanjang 

nur@nur-Satellite-L740:~$ ps l
F   UID   PID  PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
0  1000  2169  2160  20   0   6836  3164 wait   Ss   pts/0      0:00 bash
0  1000  2424  2169  20   0   4236   536 -      R    pts/0     92:16 yes
0  1000  2757  2169  20   0   4236   540 signal T    pts/0      7:57 yes
0  1000  3419  2169  20   0   6836  3148 wait   S    pts/0      0:00 bash
0  1000  3441  3419  20   0   6836  3148 wait   S    pts/0      0:00 bash
0  1000  3493  3441  20   0   4992   784 -      R+   pts/0      0:00 ps l

 s  format sinyal 

nur@nur-Satellite-L740:~$ ps s
  UID   PID   PENDING   BLOCKED   IGNORED    CAUGHT STAT TTY        TIME COMMAND
 1000  2169  00000000  00010000  00380004  4b817efb Ss   pts/0      0:00 bash
 1000  2424  00000000  00000000  00000000  00000000 R    pts/0     92:20 yes
 1000  2757  00000000  00000000  00000000  00000000 T    pts/0      7:57 yes
 1000  3419  00000000  00010000  00380004  4b817efb S    pts/0      0:00 bash
 1000  3441  00000000  00010000  00380004  4b817efb S    pts/0      0:00 bash
 1000  3494  00000000  00000000  00000000  73d3fef9 R+   pts/0      0:00 ps s

  v  format virtual memory 

nur@nur-Satellite-L740:~$ ps v
  PID TTY      STAT   TIME  MAJFL   TRS   DRS   RSS %MEM COMMAND
 2169 pts/0    Ss     0:00      2   940  5895  3164  0.1 bash
 2424 pts/0    R     92:23      0    20  4215   536  0.0 yes
 2757 pts/0    T      7:57      0    20  4215   540  0.0 yes
 3419 pts/0    S      0:00      0   940  5895  3148  0.1 bash
 3441 pts/0    S      0:00      0   940  5895  3148  0.1 bash
 3495 pts/0    R+     0:00      0    81  4910   780  0.0 ps v

 X  format register i386

nur@nur-Satellite-L740:~$ ps X
  PID   STACKP      ESP      EIP TMOUT ALARM STAT TTY        TIME COMMAND
 2169 bff1b180 bff1acd8 b7701424     -     - Ss   pts/0      0:00 bash
 2424 bff39aa0 bff398b8 b7772424     -     - R    pts/0     92:31 yes
 2757 bf9ed820 bf9ed70c b76478a1     -     - T    pts/0      7:57 yes
 3419 bfd12d00 bfd12858 b77aa424     -     - S    pts/0      0:00 bash
 3441 bfeef900 bfeef458 b7705424     -     - S    pts/0      0:00 bash
 3496 bfcb10c0 bfcb0e28 b773c424     -     - R+   pts/0      0:00 ps X

0 komentar:

Posting Komentar

luvne.com resepkuekeringku.com desainrumahnya.com yayasanbabysitterku.com