Perintah atau command ps (process status) di gunakan untuk menampilkan informasi proses yang sedang berjalan termasuk nomor PID (Process Identification Number) dari proses tersebut. Proses atau biasa disebut task akan berjalan jika ada sebuah aplikasi yang sedang dijalankan, setiap proses yang berjalan oleh system diberi nomor PID yang unik.
Syntak dasar dari perintah ps adalah
ps [option]
Jika anda menggunakan perintah ps tanpa diikuti option apapun, maka akan ditampilkan output standart dari perintah ps tersebut yang terdiri dari PID, TTY, TIME, dan CMD
contoh:
arie@natty:~$ ps
PID TTY TIME CMD
1815 pts/0 00:00:00 bash
1869 pts/0 00:00:00 ps
1. Memulai menggunakan perintah ps
Ketikkan perintah berikut untuk menampilkan semua prosess yang sedang berjalan
ps -aux | less
Contoh
arie@natty:~$ ps -aux | less
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2920 1812 ? Ss 02:49 0:00 /sbin/init
root 2 0.0 0.0 0 0 ? S 02:49 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 02:49 0:00 [ksoftirqd/0]
root 6 0.0 0.0 0 0 ? S 02:49 0:00 [migration/0]
root 7 0.0 0.0 0 0 ? S 02:49 0:00 [migration/1]
root 8 0.0 0.0 0 0 ? S 02:49 0:00 [kworker/1:0]
root 9 0.0 0.0 0 0 ? S 02:49 0:00 [ksoftirqd/1]
root 10 0.0 0.0 0 0 ? S 02:49 0:00 [kworker/0:1]
root 11 0.0 0.0 0 0 ? S< 02:49 0:00 [cpuset]
root 12 0.0 0.0 0 0 ? S< 02:49 0:00 [khelper]
root 13 0.0 0.0 0 0 ? S< 02:49 0:00 [netns]
root 15 0.0 0.0 0 0 ? S 02:49 0:00 [sync_supers]
root 16 0.0 0.0 0 0 ? S 02:49 0:00 [bdi-default]
root 17 0.0 0.0 0 0 ? S< 02:49 0:00 [kintegrityd]
root 18 0.0 0.0 0 0 ? S< 02:49 0:00 [kblockd]
root 19 0.0 0.0 0 0 ? S< 02:49 0:00 [kacpid]
root 20 0.0 0.0 0 0 ? S< 02:49 0:00 [kacpi_notify]
root 21 0.0 0.0 0 0 ? S< 02:49 0:00 [kacpi_hotplug]
root 22 0.0 0.0 0 0 ? S< 02:49 0:00 [ata_sff]
root 23 0.0 0.0 0 0 ? S 02:49 0:00 [khubd]
..........
option -a akan menampilkan semua user yang sedang menjalankan proses, option -u berfungsi untuk menampilkan semua proses ylain yang sedang berjalan, option -x berfungsi untuk menampilkan proses yang tidak dikontrol oleh terminal (tty) seperti daemon yang dijalankan saat booting.
2. Menampilkan semua proses yang sedang berjalan pada sistem
ps -A
contoh :
arie@natty:~$ ps -A
PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 ksoftirqd/0
6 ? 00:00:00 migration/0
7 ? 00:00:00 migration/1
9 ? 00:00:00 ksoftirqd/1
10 ? 00:00:00 kworker/0:1
11 ? 00:00:00 cpuset
12 ? 00:00:00 khelper
13 ? 00:00:00 netns
15 ? 00:00:00 sync_supers
16 ? 00:00:00 bdi-default
17 ? 00:00:00 kintegrityd
18 ? 00:00:00 kblockd
19 ? 00:00:00 kacpid
20 ? 00:00:00 kacpi_notify
21 ? 00:00:00 kacpi_hotplug
22 ? 00:00:00 ata_sff
23 ? 00:00:00 khubd
........
Atau gunakan perintah berikut
ps -e
3. Melihat semua proses yang berjalan kecuali root
ps -U root -u root -N
contoh:
arie@natty:~$ ps -U root -u root -N
PID TTY TIME CMD
611 ? 00:00:00 rsyslogd
615 ? 00:00:00 dbus-daemon
658 ? 00:00:00 avahi-daemon
659 ? 00:00:00 avahi-daemon
834 ? 00:00:00 xrdp
1097 ? 00:00:00 gnome-session
1147 ? 00:00:00 ssh-agent
1150 ? 00:00:00 dbus-launch
1151 ? 00:00:00 dbus-daemon
1156 ? 00:00:00 gconfd-2
1165 ? 00:00:00 gnome-keyring-d
1170 ? 00:00:00 gnome-settings-
1175 ? 00:00:00 gvfsd
1179 ? 00:00:09 compiz
......
4.Menampilkan proses yang sedang dijalankan oleh user tertentu
ps -u user
contoh :
arie@natty:~$ ps -u arie
PID TTY TIME CMD
1097 ? 00:00:00 gnome-session
1147 ? 00:00:00 ssh-agent
1150 ? 00:00:00 dbus-launch
1151 ? 00:00:00 dbus-daemon
1156 ? 00:00:00 gconfd-2
1165 ? 00:00:00 gnome-keyring-d
1170 ? 00:00:00 gnome-settings-
1175 ? 00:00:00 gvfsd
1179 ? 00:00:10 compiz
1183 ? 00:00:00 pulseaudio
1195 ? 00:00:00 gvfs-fuse-daemo
1255 ? 00:00:00 nautilus
1261 ? 00:00:00 polkit-gnome-au
1262 ? 00:00:00 bluetooth-apple
1263 ? 00:00:00 zeitgeist-datah
......
5. Menampilkan proses yang sedang berjalan dalam bentuk bagan
pstree
Selamat mencoba, jangan lupa sering berkunjung ke blog ini






Terima kasih pak,, materi ini sangat membantu saya dalam menyelesaikan tugas-tugas kuliah..
Trima kasih pak…. berguna banget buat referensi jurnal Linux saya ^_^