Share your knowledge at the LQ Wiki.
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 07-06-2012, 11:55 PM   #1
Registered: May 2012
Location: India
Distribution: CentOS,RedHat
Posts: 41

Rep: Reputation: 1
How to stop a GUI program from command line?

Dear Users,

I use RHEL6. I was configuring unpartitioned space for LVM. After creating a new partition, the mouse selection was on /boot partition and I changed the type to 0x8e by mistake.A spinning circle appeared indicating the process of changing the type from default linux 0x85 to 0x8e. I restarted and everything was okay. But the question is "Is it possible to stop such processes initiated using GUI utility from command line to prevent any damage to the configuration of the system?".

Old 07-07-2012, 12:18 AM   #2
Hungry ghost
Senior Member
Registered: Dec 2004
Posts: 1,222

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
First, you must know the process ID or its name. To see the list of processes, you can execute:

ps -ax
Once you know which process is it you want to kill, you execute:

kill -9 PID
PID is the process ID number returned by ps. You can also use the command killall with the real process name. So for example, if you want to stop firefox from the CLI, you can either execute:

killall -9 firefox

kill -9 firefox-PID
firefox-PID is the real ID number returned by ps.

There is also pkill (I haven't used this one, but you can check the man page for it, if you're interested to know about it: man pkill).

(Of course, you must be careful about which processes you kill, since there are critical process that, if killed, may cause data loss or an unstable system).

Last edited by Hungry ghost; 07-07-2012 at 07:35 AM. Reason: Correcting the information (killall -9 PID doesn't work).
Old 07-07-2012, 02:20 AM   #3
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
If you are too lazt to find the PID (like me) I recommend 'skill'.
Hope this helps.
Old 07-07-2012, 03:41 AM   #4
Registered: Jun 2012
Location: USA
Distribution: Ubuntu
Posts: 424

Rep: Reputation: 83
Old 07-07-2012, 03:53 AM   #5
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Originally Posted by rbdharnia View Post
u need to use kill command, the complete description of the tool is given below
Did you notice that the previous poster described the kill command in some detail? Your posts sometimes appear to be simply promoting your website.
Old 07-09-2012, 03:28 AM   #6
Registered: May 2012
Location: India
Distribution: CentOS,RedHat
Posts: 41

Original Poster
Rep: Reputation: 1

Thanks.that worked.


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
howto create GUI-graphical wrapper for command line program SaintDanBert Linux - Desktop 4 01-30-2011 09:24 PM
safest command-line (not GUI) program to view apache logs? bcw Linux - Security 6 12-04-2009 12:35 AM
Start 'Add/Remove' program GUI from command line j_70 Linux - Software 1 02-08-2008 03:59 PM
how to use command line program in gui Carunkumar Programming 11 12-13-2007 02:44 PM
C in Linux. The program only read the first line and then stop Linh Programming 2 07-03-2003 05:40 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:58 PM.

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