LiveFire Labs: Online UNIX Training with Hands-on Internet Lab

"Taking a LiveFire Labs' course is an excellent way to learn Linux/Unix. The lessons are well thought out, the material is explained thoroughly, and you get to perform exercises on a real Linux/Unix box. It was money well spent."

Ray S.
Pembrook Pines, Florida

LiveFire Labs' UNIX and Linux Operating System Fundamentals course was very enjoyable. Although I regularly used UNIX systems for 16 years, I haven't done so since 2000. This course was a great refresher. The exercises were fun and helped me gain a real feel for working with UNIX/Linux OS. Thanks very much!"

Ming Sabourin
Senior Technical Writer
Nuance Communications, Inc.
Montréal, Canada

Read more student testimonials...

Receive UNIX Tips, Tricks, and Shell Scripts by Email

LiveFire Labs' UNIX Tip, Trick, or Shell Script of the Week

Process Monitoring and Management - The ps Command

Although processes will normally complete their entire life cycle without any intervention from the process owner, there may be times when you will want to actively manage them. ps and kill are two commands used for managing your processes.

The ps Command

The ps command can be used to list only the processes you own, or all of the active processes on a system. The syntax for the ps command is:

$ ps [options]

Running ps without any options will display the status of the active processes you own:

$ ps
7505 pts/3 00:00:00 ksh
8078 pts/3 00:00:00 ps

This output displays four pieces of information for each process. The process's ID (PID), the terminal controlling the process (TTY), how long the process has been running (TIME), and the command or program the process is running (CMD).

If you would like to learn more details about your active processes, you can use ps with the -f option to display a full listing of your processes:

$ ps -f
student1 7505 7492 0 07:35 pts/3 00:00:00 -ksh
student1 8134 7505 0 08:57 pts/3 00:00:01 ps -f

Adding the -f option displays four additional pieces of information. The process owner's user ID (UID), the process ID of the process's parent (PPID), the central processor utilization number (C), and the process's starting time (STIME).

Running ps with the -e option will show you all of the active processes on the system, regardless of who their owner is. Since there are usually a large number of active system processes, it is wise to pipe the results of this command to the more command.

Need a simple script to monitor and restart your system processes automatically?

See ProcMonUX - a Simple Lightweight Process Monitor Script with Alerts, Restart and Logging for more info. It works with both UNIX and Linux...and it's FREE!