Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: ubuntu logout command line

  1. #1
    Join Date
    Aug 2008
    Beans
    573

    ubuntu logout command line

    Besides the command listed below are there any other useful logout commands, to log out of ubuntu? I was quite surprised that logout doesn't work. Logout tells you to use exit and exit only closes your terminal window.
    Code:
    gnome-session-save --kill --silent

  2. #2
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: ubuntu logout command line

    Code:
    exit
    Are you wanting to log out of a bash session (terminal) or an X session ?
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  3. #3
    Join Date
    Aug 2009
    Location
    United States
    Beans
    4,523
    Distro
    Ubuntu Development Release

    Re: ubuntu logout command line

    Code:
    sudo shutdown -h now
    (shutdown)
    Code:
    sudo shutdown -r now
    (restart)
    Remember hence where you come and pass it down.
    Ubuntu Forums member #899097 and Ubuntu Member:


  4. #4
    Join Date
    Nov 2008
    Location
    Southern Ontario, Canada
    Beans
    253
    Distro
    Ubuntu Development Release

    Re: ubuntu logout command line

    That's because the terminal the GUI uses is actually running in the backround, and the terminal windows are 'fake' terminals if you want to call it that. Press 'Ctrl + Alt + F1' (All the way to F6) to use a real terminal, and 'Ctrl + Alt + F7' to return to your GUI. There 'logout' will work.

  5. #5
    Join Date
    Feb 2008
    Location
    The Hague,Netherlands
    Beans
    252
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: ubuntu logout command line

    Code:
    sudo halt now -h
    Registered Linux user,number 507113.02-01-2013: ASUS M4A785TD-V EVO 785G |Athlon 2 X4 640|4 GiB DDR|1 TiB SATA2|Radeon HD 6570(HDMI)|Realtek 7.1 HDMI audio|Gigabit Lan|Kubuntu 12.10 Quanzal AMD64

  6. #6
    Join Date
    Aug 2008
    Beans
    573

    Re: ubuntu logout command line

    Quote Originally Posted by bodhi.zazen View Post
    Code:
    exit
    Are you wanting to log out of a bash session (terminal) or an X session ?
    Whats a X session?

    Quote Originally Posted by Serpher View Post
    That's because the terminal the GUI uses is actually running in the backround, and the terminal windows are 'fake' terminals if you want to call it that. Press 'Ctrl + Alt + F1' (All the way to F6) to use a real terminal, and 'Ctrl + Alt + F7' to return to your GUI. There 'logout' will work.
    Is there a way to to that terminal from a shell script and also log in with that shell script? I know whenever you press 'Ctrl + Alt + F1' it always asks you to log in.

  7. #7
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: ubuntu logout command line

    Quote Originally Posted by COKEDUDE View Post
    Whats a X session?
    X = the graphical interface, the desktop. X is the system that manages your video, keyboard, and mouse.

    http://www.x.org/wiki/

    The desktop interface (gnome, KDE, xfce) are built on top of X.

    http://xwinman.org/

    Is there a way to to that terminal from a shell script and also log in with that shell script? I know whenever you press 'Ctrl + Alt + F1' it always asks you to log in.
    What are you wanting to do exactly ?

    It is confusing as you are new and you are not using "standard terminology". When you hit ctrl-alt-F1 you are at a console.

    In a graphical session, when you open a terminal, you are in a X session.

    The command line is called bash.

    The module, if you will, that manages login is called pam

    http://en.wikipedia.org/wiki/Linux_PAM
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  8. #8
    Join Date
    Jun 2009
    Location
    Manchester
    Beans
    87

    Re: ubuntu logout command line

    How about

    Code:
    # service gdm restart

  9. #9
    Join Date
    Aug 2008
    Beans
    573

    Re: ubuntu logout command line

    Quote Originally Posted by bodhi.zazen View Post
    X = the graphical interface, the desktop. X is the system that manages your video, keyboard, and mouse.

    http://www.x.org/wiki/

    The desktop interface (gnome, KDE, xfce) are built on top of X.

    http://xwinman.org/



    What are you wanting to do exactly ?

    It is confusing as you are new and you are not using "standard terminology". When you hit ctrl-alt-F1 you are at a console.

    In a graphical session, when you open a terminal, you are in a X session.

    The command line is called bash.

    The module, if you will, that manages login is called pam

    http://en.wikipedia.org/wiki/Linux_PAM
    I'm working on writing a shell script that logs out whenever I have a firefox process running during certain times of the day (1 am - 8 am). I'll put it in crontab when it runs properly unless someone knows of a different and better way to do this. Here it is so far.

    Code:
    if ps ax | grep firefox-3.6.3
    then 
    echo hi
    /usr/bin/gnome-session-save --kill --silent
    exit 0 
    fi
    Its not working yet cause grep isn't filtering the way I need it to. This is what I get when firefox is running.
    Code:
    ps ax | grep firefox-3.6.3
     1859 ?        S      0:00 /bin/sh /usr/lib/firefox-3.6.3/firefox
     1864 ?        S      0:00 /bin/sh /usr/lib/firefox-3.6.3/run-mozilla.sh /usr/lib/firefox-3.6.3/firefox-bin
     1868 ?        Sl     1:45 /usr/lib/firefox-3.6.3/firefox-bin
     3374 pts/0    S+     0:00 grep --colour=auto firefox-3.6.3
    This is what I get when firefox is not running.
    Code:
    ps ax | grep firefox-3.6.3
     3374 pts/0    S+     0:00 grep --colour=auto firefox-3.6.3
    I need it to ignore the grep filtering process.

  10. #10
    Join Date
    Jun 2009
    Beans
    1,043

    Re: ubuntu logout command line

    how about:

    Code:
     sudo reboot
    concise and to the point...

    It's funny because just last week I was wondering how to do this.

    BM

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •