knowing what's running on Ubuntu
Sometimes, I left my beaglebone running over night, and next morning I can't remember what's running on back ground.
the command ps can be help.
http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/
with out additional parameter, it list what I own. the PID is Process Identification
ubuntu@arm:~$ ps
PID TTY TIME CMD
12914 pts/0 00:00:00 bash
17211 pts/0 00:00:00 ps
the command ps can be help.
http://www.cyberciti.biz/faq/show-all-running-processes-in-linux/
with out additional parameter, it list what I own. the PID is Process Identification
ubuntu@arm:~$ ps
PID TTY TIME CMD
12914 pts/0 00:00:00 bash
17211 pts/0 00:00:00 ps
there are options:
- -A: select all processes
- a: select all processes on a terminal, including those of other users
- x: select processes without controlling ttys
with ps a I can see if my python program is running for how long..
ubuntu@arm:~$ ps a
PID TTY STAT TIME COMMAND
534 tty4 Ss+ 0:00 /sbin/getty -8 38400 tty4
536 tty5 Ss+ 0:00 /sbin/getty -8 38400 tty5
544 tty2 Ss+ 0:00 /sbin/getty -8 38400 tty2
545 tty3 Ss+ 0:00 /sbin/getty -8 38400 tty3
549 tty6 Ss+ 0:00 /sbin/getty -8 38400 tty6
760 tty1 Ss+ 0:00 /sbin/getty -8 38400 tty1
761 ttyO0 Ss 0:00 /bin/login --
850 ttyO0 S 0:00 -bash
895 ttyO0 Sl+ 1525:27 python python_test_bone_try9_data_receive_assem_gdat
12914 pts/0 Ss 0:00 -bash
17580 pts/0 R+ 0:00 ps a
ubuntu@arm:~$
Once we know the PID, we can stop it wirh kill PID
ubuntu@arm:~$ kill 895
ubuntu@arm:~$ ps a
PID TTY STAT TIME COMMAND
534 tty4 Ss+ 0:00 /sbin/getty -8 38400 tty4
536 tty5 Ss+ 0:00 /sbin/getty -8 38400 tty5
544 tty2 Ss+ 0:00 /sbin/getty -8 38400 tty2
545 tty3 Ss+ 0:00 /sbin/getty -8 38400 tty3
549 tty6 Ss+ 0:00 /sbin/getty -8 38400 tty6
760 tty1 Ss+ 0:00 /sbin/getty -8 38400 tty1
761 ttyO0 Ss 0:00 /bin/login --
850 ttyO0 S+ 0:00 -bash
12914 pts/0 Ss 0:00 -bash
18007 pts/0 R+ 0:00 ps a
ubuntu@arm:~$
ubuntu@arm:~$ kill 895
ubuntu@arm:~$ ps a
PID TTY STAT TIME COMMAND
534 tty4 Ss+ 0:00 /sbin/getty -8 38400 tty4
536 tty5 Ss+ 0:00 /sbin/getty -8 38400 tty5
544 tty2 Ss+ 0:00 /sbin/getty -8 38400 tty2
545 tty3 Ss+ 0:00 /sbin/getty -8 38400 tty3
549 tty6 Ss+ 0:00 /sbin/getty -8 38400 tty6
760 tty1 Ss+ 0:00 /sbin/getty -8 38400 tty1
761 ttyO0 Ss 0:00 /bin/login --
850 ttyO0 S+ 0:00 -bash
12914 pts/0 Ss 0:00 -bash
18007 pts/0 R+ 0:00 ps a
ubuntu@arm:~$
留言
張貼留言