LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-22-2008, 11:41 AM   #1
htamayo
Member
 
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
Poetics
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
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

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

Code:
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...

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

Rep: Reputation: 15
Or -

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


Reply


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


All times are GMT -5. The time now is 12:51 PM.

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