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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-04-2017, 05:39 PM
|
#1
|
Member
Registered: Sep 2005
Location: New Jersey, USA
Distribution: VMware V12 and V15 in Windows 10, MX Linux 23.1, Kubuntu 23.10, IBM z/VM 5.4
Posts: 559
Rep:
|
Using the PS Command
Greetings,
How do you use the PS command to see if a particular program (demon) is running.
PS -ef gives a whole lot of information but it's just to much and I only am looking for one program.
Thanks
|
|
|
02-04-2017, 05:56 PM
|
#2
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,251
|
If you know the full name, use "-C" - documented in the manpage.
If not, pipe it to grep.
|
|
|
02-04-2017, 06:31 PM
|
#3
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
If you know the process name, just ask for the pid using
|
|
|
02-04-2017, 11:14 PM
|
#4
|
Member
Registered: Jul 2013
Posts: 749
Rep:
|
pgrep is also handy
|
|
|
02-04-2017, 11:40 PM
|
#5
|
Member
Registered: May 2011
Location: Texas
Distribution: Primarily Deb/Ubuntu, and some CentOS
Posts: 833
|
http://linuxcommand.org/man_pages/ps1.html
example:
Code:
erik@mymachine:~$ ps aux | grep erik | grep kde
erik 328 0.0 0.0 10700 340 ? Ss 17:51 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/startkde
erik 331 0.0 0.0 24504 1828 ? S 17:51 0:00 /usr/bin/dbus-launch --exit-with-session /usr/bin/startkde
erik 372 0.0 0.0 4084 80 ? S 17:51 0:00 /usr/lib/kde4/libexec/start_kdeinit +kcminit_startup
erik 373 0.0 0.3 404084 62120 ? Ss 17:51 0:00 kdeinit4: kdeinit4 Running...
erik 374 0.0 0.2 410356 39884 ? S 17:51 0:00 kdeinit4: klauncher [kdeinit] --fd=9
erik 376 0.0 0.4 1492000 68532 ? Sl 17:51 0:01 kdeinit4: kded4 [kdeinit]
erik 601 0.0 0.3 594248 51680 ? Sl 17:51 0:00 kdeinit4: ksmserver [kdeinit]
erik 606 0.0 0.1 386852 30292 ? Sl 17:51 0:00 /usr/lib/kde4/libexec/kdeconnectd
erik 1251 0.0 0.2 395744 33460 ? Sl 17:51 0:00 /usr/lib/kde4/libexec/polkit-kde-authentication-agent-1
erik 3532 0.0 0.0 12732 2280 pts/0 S+ 23:39 0:00 grep kde
erik 32753 0.0 0.0 4336 1572 ? Ss 17:51 0:00 /bin/sh /usr/bin/startkde
|
|
|
02-07-2017, 05:04 AM
|
#6
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
Note that it's "ps" and not "PS", linux is case sensitive.
$ COLUMNS=300 ps -FlAw | grep -i X
And +1 to pgrep being useful.
$ kill -9 $(pgrep chrome)
Poor mans killall. Or at least for those too lazy / underprivileged to install killall.
|
|
|
All times are GMT -5. The time now is 06:43 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|