Introduction to Data Communications
Previous 51c. Links, Instances & Processes (cont'd) Next

ps - Process Status

In order to see which processes are operating under your account, type "ps". "ps" stands for Process Status and will display all processes that are currently operating.

	ps



	PID	TTY	TIME	COMMAND

	16852	1a	0:02	ksh

	16889	1a	0:00	ps

When the "ps" command is entered, a display similar to the above will be displayed.

The "ps" command is very useful in determining if you have safely exited a program. Quite often in Unix, you may get bumped from a process (such as ftp) and end up disconnected. The ftp process may still be running. When you log back on, check to see what processes you have open using "ps".


kill

If you were bumped out or locked up in a process, you can usually escape back to the command line by doing one or all of the following key stroke commands:

	ctlr d		End input (End of file)

	ctrl z		Pause  Job

	ctrl c		Kill job

	ctrl x		Quit program

In order to terminate the process, you would first use the "ps" command to find out if the process is still running and what PID is associated with it.

Example:

While using the E-mail package "pine", it locked up and the above key combinations were pressed in a mad frenzy. Fortunately, we were returned to the command line prompt. "ps" was typed in to see what the process status was:

	ps



	PID	TTY	TIME	COMMAND

	16852	1a	0:02	ksh

	16889	1a	0:12	pine

	16957	1a	0:12	ps

This indicated that "pine" was still running. In order to terminate or stop "pine", the kill command is used with the PID of the process that we want to terminate:

	kill 16889			This will kill "pine"

Unfortunately, sometimes the kill command by itself will not work on all flavours of UNIX. Sometimes you may have to use some extra options such as:

	kill -kill 16889

You can escalate the "degree" of kill by using the option "-9" and if that doesn't work then perform the kill on steroids "-15":

	kill -9 16889



	kill -15 16889


Introduction to Data Communications
Previous Table of Contents Next