Results 1 to 6 of 6
Now another one my silly doubt
when I press cnrtl+d on mu console the logout command is executed, but when i start a bash and press cnrtl+d the exit command ...
- 05-11-2009 #1
logout vs exit
Now another one my silly doubt
when I press cnrtl+d on mu console the logout command is executed, but when i start a bash and press cnrtl+d the exit command is executed. Also it is possible to logout using the exit command directly.
so are both logout and exit command the same as in are they symlink to each other.
Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu
- 05-11-2009 #2
Exit will exit from the shell you are in.
if you are in your login shell you will logout.
- 05-11-2009 #3
so does that mean that both commands can be used interchangeably.
Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu
- 05-12-2009 #4
sort of, but those are different...
Logout will not work on non login shells, like gnome-terminal/x-term or anyother shell you get on telnet,ftp,etc
Exit is for any shell, login shell or non-login shell
- 05-13-2009 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,970
Also, when you exit the login shell (assuming the shell is bash), the script ~/.bash_logout is executed, giving you the opportunity to clean up anything you need before exiting. For example, in my .bash_login, I mount some CIFS remote drives (Windows shares, NAS directories, etc), so when I logout, those mounts are terminated properly.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 05-13-2009 #6
ok when you press cntrl+d the file .bash_logout in the home directory of the user is executed, but is there a file that gets executed for exit as well???
Only if I could understand the man pages
Registered Linux user #492640
OS: RHEL4,5 ,RH 9,Ubuntu


Reply With Quote