Is there a terminal command that will log you out of your current desktop session and take you back to the login screen?
Ubuntu – How to you log out via the terminal
command linelogout
command linelogout
Is there a terminal command that will log you out of your current desktop session and take you back to the login screen?
Best Answer
11.10 and above
11.04 and previous versions
(via
DoR, see his answer to "Reboot without sudoer privileges?" for more dbus goodness!)
or alternatively, you can use
--force-logout
in contrast to just--logout
will not ask the user to deal with unsaved documents and so on.Yes, there is a command called logout, but it concerns the Terminal. gnome-session-save is the program that actually quits the
gnome-session
, which you can of course kill, but that wouldn't qualify as logging out. :-)Notice as well that these commands don't require you to be root.
You can always add an alias to your system if you want to have a shorter command.
Open
~/.bash_aliases
with a text editor, or create it if it isn't there, and add something like this to it:(.bashrc is a script that is run every time a new virtual terminal is started up, you should set up all your permanent aliases there, see also: How to create a permanent "alias"?)