

The best part is that while the grep command line still has the brackets, grep itself strips them away and treats it as a single character, so we don’t match our own command line. We only put one character in the set, so “” is the equivalent of searching for just “p”. Grep sees the characters in brackets as a set and matches any of the characters you provide. The simplest way is to put the first character of the search pattern in brackets: ps -ef|grep mon $ ps -ef|grep mon A better way is to use a regular expression with grep to keep it from matching itself. However, this starts another process, and takes time and resources. This excludes the grep command itself from the search. So, one thing you commonly see in a shell script to check for a process is “ps -ef|grep pmon|grep -v grep”. This is because the “pmon” argument to grep shows up on the command line. One of the problems in using “ps -ef|grep pmon” to look for the pmon process, for example, is that you also see the grep command itself: $ ps -ef|grep pmon oraclexe 6179 1 0 20:00 ? 00:00:00 ora _ xe _ pmon _ XE The “-e” option lists all processes running on the system, and “-f” give a “full” listing, which lists more columns of information, such at process start time, and the process ID of the parent process. ps -fu oracle), to look for a particular process by process ID (ps -fp PID), and to look for a process across the whole system (ps -ef|grep pmon). Some typical uses are to look at all processes for a user (e.g. Of course the most used utility by anyone is the “ps” command. In this brief article, I will talk about those I use nearly every day to work with Oracle systems. There are a great deal of useful tools and scripting languages, enough to fill several volumes.

#Ps ef unix command how to
In this article I’m going to discuss some of my favorite utilities and show examples of how to use them. Regardless of your work environment, knowing how to troubleshoot from the Unix operating system can help you discover problems that you could not find just by looking in Oracle. In some companies, the Oracle DBA and the System Administrator are one and the same, and in others there are teams of both. Content has been updated where appropriate. David Woodard | Originally appeared in March 2006 Bricks newsletter.
