How can I safely shut down Xfce from the terminal?

32,043

I think what you want is xfce4-session-logout (online manpage).

Excerpt from the manpage (reformatted, filtered):

   The  xfce4-session-logout command allows you to programmatically logout
   from your Xfce session. It requests the session manager to display  the
   logout  confirmation  screen,  or,  if  given  one  of the command-line
   options below, causes the session manager to take the requested  action
   immediately.

OPTIONS:
   --logout     Log out without displaying the logout dialog.
   --halt       Halt without displaing the logout dialog.
   --reboot     Reboot without displaying the logout dialog.
   --suspend    Suspend without displaying the logout dialog.
   --hibernate  Hibernate without displaying the logout dialog.
   --fast       Do  a  fast shutdown.  This instructs the session manager not to
                save the session, but instead to quit everything quickly.

So to shut down, use

xfce4-session-logout --halt

and to reboot, use

xfce4-session-logout --reboot

If you just want to get the dialogue where you can pick an action manually, run it without arguments:

xfce4-session-logout 
Share:
32,043

Related videos on Youtube

Michael Hoffmann
Author by

Michael Hoffmann

I'm a Computer Science student at Utah State University. I've got over a decade of hobby experience with C#, JavaScript, and Python, a few years with C++ and Java, and maybe a few burn scars from soldering irons. I have no idea what I want to be when I grow up. I just want nice income and insurance.

Updated on September 18, 2022

Comments

  • Michael Hoffmann
    Michael Hoffmann over 1 year

    I'm not looking for shutdown or reboot or the like. I want to know how to shut down Xubuntu from the terminal, by executing a command that would have the same effect as clicking the "Shutdown" button in a menu.

    Similar to this question, but for Xubuntu/XFCE.

    • blade19899
      blade19899 almost 8 years
      Similar as in shutting down form a gui: sudo halt --poweroff