Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: ubuntu logout command line

  1. #11
    Join Date
    Aug 2008
    Beans
    573

    Re: ubuntu logout command line

    Quote Originally Posted by blur xc View Post
    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
    I wanna logout not reboot .

  2. #12
    Join Date
    Jun 2009
    Beans
    1,043

    Re: ubuntu logout command line

    Quote Originally Posted by COKEDUDE View Post
    I wanna logout not reboot .

    I guess my reply was more directed at post #3's sudo shutdown -r now to reboot. sudo reboot is a lot less typing.

    BM

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

    Re: ubuntu logout command line

    Code:
    if ps ax | grep 1859
    then 
    echo hi
    /usr/bin/gnome-session-save --kill --silent
    exit 0 
    fi
    Every process has a number.

  4. #14
    nmaster is offline Extra Foam Sugar Free Ubuntu
    Join Date
    Jun 2009
    Beans
    718

    Re: ubuntu logout command line

    Quote Originally Posted by COKEDUDE View Post
    I need it to ignore the grep filtering process.
    try this instead:
    Code:
    top -b -n 1 | grep firefox
    use whatever process name is appropriate.

  5. #15
    nmaster is offline Extra Foam Sugar Free Ubuntu
    Join Date
    Jun 2009
    Beans
    718

    Re: ubuntu logout command line

    Quote Originally Posted by Serpher View Post
    Code:
    if ps ax | grep 1859
    then 
    echo hi
    /usr/bin/gnome-session-save --kill --silent
    exit 0 
    fi
    Every process has a number.
    that doesn't avoid the issue that the OP is having. grep still finds itself in the output of ps

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

    Re: ubuntu logout command line

    Quote Originally Posted by neal.m.master View Post
    that doesn't avoid the issue that the OP is having. grep still finds itself in the output of ps
    Im' not sure what youre trying to say. Wouldn't it just check if Firefoxs process is running by using it's process number?

  7. #17
    nmaster is offline Extra Foam Sugar Free Ubuntu
    Join Date
    Jun 2009
    Beans
    718

    Re: ubuntu logout command line

    Quote Originally Posted by COKEDUDE View Post
    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
    you need to kill Xorg and then try the logout command.

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

    Re: ubuntu logout command line

    I was just assuming the rest of his code worked. If the script were executed as root in the if statment Id put

    Code:
    service gdm restart
    TBH your kid or whomever is just going to install Chrome or something. Stop network manager instead cutting off the internet at 1 and beyond, and turn it on after 8.

  9. #19
    Join Date
    Jun 2009
    Beans
    90

    Re: ubuntu logout command line

    Quote Originally Posted by COKEDUDE View Post
    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.
    Try one of this:
    Code:
    ps ax | grep [f]irefox
    pgrep firefox

  10. #20
    nmaster is offline Extra Foam Sugar Free Ubuntu
    Join Date
    Jun 2009
    Beans
    718

    Re: ubuntu logout command line

    Quote Originally Posted by Serpher View Post
    Im' not sure what youre trying to say. Wouldn't it just check if Firefoxs process is running by using it's process number?
    no. it will check for any process that uses that set of characters. that would include grep. just try it.

Page 2 of 3 FirstFirst 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
  •