Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-22-2008, 11:41 AM   #1
Registered: Jan 2005
Location: san salvador, el salvador
Distribution: Debian Stable, UbuntuStudio Karmic Koala
Posts: 190

Rep: Reputation: 30
how to know if a particular process is running

Hi, I need to know if mysql and apache -for example- are running, if I do ps -all it will list me all the process that are running, but is there a way to know if mysql, apache or other process is running?

An example:
some_monitor_command mysql
some_monitor_command apache

Second question:
Sometimes I use more than one session at the same time, for example graphical mode, tty2 (using Alt+F2), tty3 (Alt+F3), so, I do everything I need in tty3 for example, my question is:

Once I finished to use tty3 is there a way to kill tty3? if I go to tty2 and I do a ps -all I can see the process in tty3, so I want to kill all the tt3, can you help me?
Old 01-22-2008, 11:44 AM   #2
Senior Member
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
You can grep the results if you wish, such as "ps auxww | grep apache" and the like. This will return only the lines with 'apache' in them, and will scan all currently running processes.
Old 01-22-2008, 11:46 AM   #3
Senior Member
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,978
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Try using grep to find out what is running...for example:

ps aux | grep httpd
ps aux | grep mysql
Also if you don't know what you're looking for is called you can use different switches with grep (like grep -i) man grep for more details...

Old 01-22-2008, 11:53 AM   #4
LQ Newbie
Registered: Jun 2003
Distribution: Slackware
Posts: 29

Rep: Reputation: 15
Or -

ps -ef | grep httpd
ps -ef | grep mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how know if process running shifter Programming 7 06-18-2007 03:37 AM
how do i bring up a running process? szandor Linux - General 2 02-28-2007 04:14 AM
Unnecessary process running Swift&Smart Linux - Software 2 12-05-2004 03:36 AM
Running process sonu1082 Linux - Software 2 11-25-2004 05:32 AM
Process not running LinuxRam Linux - Newbie 4 09-09-2004 12:45 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration