Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
I've run into an issue trying to set up a little bit of ASCII art to display upon connection and on logout.
I can do this for one user with .bashrc and with .bash_logout, and set a login MOTD by creating /etc/profile.d/motd.sh, but haven't found a way to set a universal logout MOTD. How can I do this?
I am running CentOS 6.
asked Jun 8, 2015 at 15:06
Austin BurkAustin Burk
32111 gold badge33 silver badges1515 bronze badges
From the manual (
When a login shell exits, bash reads and executes commands from the files ~/.bash_logout and /etc/bash.bash_logout, if the files exists.
There is another answer on U&L SE on login messages.
answered Jun 8, 2015 at 17:05
15.4k77 gold badges5050 silver badges6464 bronze badges
You must log in to answer this question.
Not the answer you're looking for? Browse other questions tagged
motdis a message ("message of the day", thus
motd), that is used for announces such as "This machine will be down for scheduled maintenance on Friday between 12:00 and 14:00".
.bash_logoutis a script. You can set a
.bash_logoutscript for new users by adding it to
/etc/skel, and you can add commands to
.bash_logoutfor existing users with a script. But (1) it's pointless to print messages from
.bash_logout(since the shell is going away...), and
.bash_logoutonly applies to people who has
bashas their shell.