LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2016, 10:37 AM   #1
abbyking
LQ Newbie
 
Registered: Dec 2016
Location: India
Posts: 5

Rep: Reputation: Disabled
How to logout [command] ?


I don't know the command , to logout . I am using RHEL 5 ,no GUI.
I would also like to know the command for logging out , for RHEL 5 , with GUI.
Thank You.
 
Old 12-02-2016, 10:44 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326

Rep: Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920Reputation: 920
exit ?
ctrl-d ?
 
Old 12-02-2016, 10:45 AM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
logout ?


Or do you mean a command that you can type in that will log you out of the gui?
 
Old 12-02-2016, 11:43 AM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,370

Rep: Reputation: 563Reputation: 563Reputation: 563Reputation: 563Reputation: 563Reputation: 563
When you are at the command line the command to logout is:

logout

When you are using a GUI you logout by clicking on a menu entry. Each GUI uses a different click sequence to logout. What GUI are you using?

--------------------
Steve Stites
 
Old 12-02-2016, 11:49 AM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
RHEL uses gnome by default. If you are, in fact, asking for how to log out of the gui from the command line, you can type this:

Code:
DISPLAY=:0 gnome-session-quit --force
 
Old 12-02-2016, 12:05 PM   #6
abbyking
LQ Newbie
 
Registered: Dec 2016
Location: India
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am using RHEL 5 . I am using using GUI . I want to know a command . so that when i enter a command from shell/terminal then the system will logout.
 
Old 12-02-2016, 12:09 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143
Quote:
Originally Posted by abbyking View Post
I am using RHEL 5 ,no GUI.
Quote:
Originally Posted by abbyking View Post
I am using RHEL 5 . I am using using GUI .
Which is it? Have you tried anything posted so far?
 
Old 12-02-2016, 12:15 PM   #8
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by abbyking View Post
I am using RHEL 5 . I am using using GUI . I want to know a command . so that when i enter a command from shell/terminal then the system will logout.
I just answered you. Did you have success doing what I said?
 
Old 12-02-2016, 12:21 PM   #9
abbyking
LQ Newbie
 
Registered: Dec 2016
Location: India
Posts: 5

Original Poster
Rep: Reputation: Disabled
[mac-lin@localhost ~]$ gnome-session-quit --force
bash: gnome-session-quit: command not found
 
Old 12-02-2016, 12:24 PM   #10
abbyking
LQ Newbie
 
Registered: Dec 2016
Location: India
Posts: 5

Original Poster
Rep: Reputation: Disabled
hey! after a lot of time searching this forum ,i found that this
Quote:
gnome-session-save --kill
is working.
so when I type this in shell/terminal In rhel5(GUI), i get a gui message with options to logout restart shutdown.
 
Old 12-02-2016, 12:26 PM   #11
abbyking
LQ Newbie
 
Registered: Dec 2016
Location: India
Posts: 5

Original Poster
Rep: Reputation: Disabled
But how to logout when using rhel5(NO GUI) only text user interface , what is the command
because iam sure that this
Quote:
gnome-session-save --kill
will not be useful there.
 
Old 12-02-2016, 01:00 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,469

Rep: Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218Reputation: 6218
See man pages for gnome-session-save.

Have you tried the --logout or --force-logout options?

As stated logout or exit will logout from a non GUI terminal.
 
Old 12-02-2016, 08:08 PM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243Reputation: 2243
Quote:
Originally Posted by abbyking View Post
I don't know the command , to logout . I am using RHEL 5 ,no GUI.
I would also like to know the command for logging out , for RHEL 5 , with GUI.
Thank You.
Code:
sudo pkill -u "username"
Not sure if that will work for RHEL but I use it in a install of linux with fluxbox without a login manager in my term to logout of that and get me back to my login cli screen.

if you're just running the login screen then did you try logout?

Last edited by BW-userx; 12-02-2016 at 08:09 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] shutdown and logout command in red hat vikram015 Linux - Newbie 2 11-13-2012 08:05 AM
command for getting logout window biplabbijay Linux - Newbie 9 04-15-2010 05:28 AM
login/logout command zacherrin Linux - Newbie 8 02-10-2006 12:36 AM
Gnome Logout Command kimchee411 Linux - Newbie 1 10-18-2004 12:45 AM
Question: How do you cleanly logout of X using command line? tzeng865 Linux - General 15 01-31-2003 03:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration