LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-09-2003, 07:10 AM   #1
yarnar
LQ Newbie
 
Registered: Nov 2003
Location: Bangalore,India.
Posts: 20

Rep: Reputation: 0
Single command to shut X down...?


My default run level is 3. With no GUI.
$ startx&
I got GUI(GNOME/KDE) at tty7

Now I dont want GUI.
What should I kill at tty1 ?

I want - Single command to shut GNOME/KDE and X with out getting ready for another login session.

Please.........
 
Old 12-09-2003, 07:35 AM   #2
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
The command is
killall X

Or you could just press Ctrl-C in the same tty where you typed startx if you omit the '&'.

Edit: This is actually faster (=fewer key-strokes). Type 'fg' <enter> to bring back X to the foreground. Then press Ctrl-C. There are probably more ways...

Regards
Martin


Last edited by MartinN; 12-09-2003 at 07:41 AM.
 
Old 12-09-2003, 07:56 AM   #3
yarnar
LQ Newbie
 
Registered: Nov 2003
Location: Bangalore,India.
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks a lot.
I was wondering how to use killall, as no book I have has its usage.
 
Old 12-09-2003, 07:58 AM   #4
yarnar
LQ Newbie
 
Registered: Nov 2003
Location: Bangalore,India.
Posts: 20

Original Poster
Rep: Reputation: 0
Oh no, Mr MartinN,
It's getting ready for another login session.
I guess U did,t fully read my question.
Thanks anyway
 
Old 12-09-2003, 08:11 AM   #5
MartinN
Member
 
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
Ehh... What?

I'm sorry, I'm not following you.

How much of this is true:

o You log in in terminal mode.
o You get to a (bash) terminal.
o You type startx& to bring up X.
o You press Ctrl-Alt-F1 to get back to terminal mode.
o You type killall X to get rid of X.

Don't you get back to your terminal prompt then? You should see the bash prompt again. Do you have to log in again? What Linux distribution are you using?

Regards
Martin
 
Old 12-09-2003, 09:59 AM   #6
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
Press CTRL + ALT + BACKSPACE

This will kill the X session and you will return to the hash or dollar prompt.

Alternately, you can do a ps -aux and check the PID of X and then on terminal give the following command

killall -KILL X

One thing to note here is that if you dont run X as a background process ( that is, startx &), and then if you kill X, its parent process, which is the bash shell, will also be killed. Thus, you will go back to the login prompt.

To avoid this, it is necessary that you run X in the background. Then only you will be brought back to the command prompt after the X session is killed.

Regards,

amit
 
Old 12-11-2003, 04:15 AM   #7
yarnar
LQ Newbie
 
Registered: Nov 2003
Location: Bangalore,India.
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for ur concern.

Sorry Mr. MartinN,
It is now working as you said.
Sorry for the trouble I gave you.
I dont know what waswrong with me but only GNOME closed yesterday and it (X) again prompted for login. Terminal mode was on.

Thanks to Mr Amit,
For tellinmg me the Keybord short cut command.
More so, as I like to know Keyboard shortcuts.
 
  


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
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Turning off computer with a single command xuper Linux - Newbie 11 05-27-2005 12:41 PM
Command for shut down of X acidblue Linux - General 2 07-21-2004 08:21 PM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 08:14 PM
Command to combine several files as a single file, etc. satimis *BSD 3 06-10-2004 04:59 AM


All times are GMT -5. The time now is 06:18 AM.

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