Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How to get logout from Gnome session via command line ? Also Is there any way in GNOME to do "switch user" from command line ?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Ah !

I got the answer for my own Question.

I have the command to logout from GNOME session as:

gnome-session-save --kill --silent

And, for user-switching, It looks like that I need to use

fusa

[ still figuring out the exact command-line ]

share|improve this answer

Depending on your distro's configuration, you can usually switch user just by jumping back to the console that GDM is running on or to the console the other user is active on using Ctrl+Alt+F* combinations, (try F6, F7, etc until you find it).

To logout, I would think all you need to do is send a kill signal to the gnome-session process and it would jump right on that for you :) Send it a nice signal first to give it a change to do it's shutdown thing.

share|improve this answer
    
Exact command will be more helpful for me :-) –  SHW Apr 28 '11 at 11:45

In Ubuntu 12.10...

gnome-session-quit --logout

Logs me out.

dm-tool switch-to-greeter

Lets me switch user.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.