Book Image

CentOS System Administration Essentials

Book Image

CentOS System Administration Essentials

Overview of this book

Table of Contents (18 chapters)
CentOS System Administration Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Managing processes


The bulk of this chapter will visit the procps package and the p series commands that we can use to manage our processes to make sure that we can fully appreciate the power that these tools can offer from the command line.

Many administrators are accustomed to using the ps command to determine the running process, and often the output is then piped to grep to search for a given process name. Although there is nothing incorrect with this as such, we may prefer to use tools that streamline these steps and are specifically designed tools for the purpose. For the moment, we will ignore the /ps command in preference of more specific tools with a real purpose to their binary lives.

Using the pgrep command

The /usr/bin/pgrep command really does become a snap-in replacement for the ps and grep pipelines we use all too often. For example, if I start my Apache web server, I can easily check the Process IDs (PIDs) in use by the service:

# service httpd start
# pgrep httpd

The output...