Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 02-15-2012, 02:12 AM   #1
Senior Member
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,399
Blog Entries: 7

Rep: Reputation: 167Reputation: 167
how t have a command launched when ever i logoff

Hello, i would like a command to be launched so i can remove some catch files, when ever i logoff. How does one go about doing this?
Old 02-15-2012, 02:17 AM   #2
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 191Reputation: 191
This will probably vary between distro and shell..
But with bash, creating a script and calling it from ~/.bash_logout, and(or) /etc/bash_logout should work.
Old 02-15-2012, 03:40 PM   #3
Senior Member
Registered: Jan 2011
Location: Australia
Distribution: OpenSUSE
Posts: 1,399

Original Poster
Blog Entries: 7

Rep: Reputation: 167Reputation: 167
yes I am using bash. thanks for your help. will this work every time I logout on the GUI?
Old 02-15-2012, 04:51 PM   #4
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 36
My experience was this did not work if your system directly [ie run level 4] boots a gui login. If you use startx after login then close the window manager and logout via bash it works fine. Now this was at least six years ago.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
force logoff a user from the command line? cccc Debian 6 10-05-2011 05:32 PM
which command is resposible for logoff action though desktop? redhotiron Linux - Desktop 2 07-22-2007 10:12 AM
logoff scripts wwnexc Linux - Security 2 09-06-2005 04:24 PM
Problem regarding logoff anoopkv1 Linux - Software 1 03-30-2005 12:56 PM
X Windows LOGOFF anima_a_ignifer Linux - Software 0 11-06-2002 08:23 AM > Forums > Linux Forums > Linux - General

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

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