Turn off the banner in Unix

To turn off the banner in Unix, create a special file in your login directory called .hushlogin. At your Unix shell prompt, enter:

touch .hushlogin
Important:

The banner includes important information such as policy and downtimes. If you create a .hushlogin file, you will never see this information. The banner is stored in a file called /etc/motd. (Motd stands for "message of the day"). To see the banner, at your Unix shell prompt, enter:

more /etc/motd

The banner message does not change very often. If you are using csh or tcsh and would prefer to know when the message has been changed so that you can read it at that time, add the following lines to your .login file:

  cmp -s ${HOME}/.hushlogin /etc/motd
  if ($status) then
    tee ${HOME}/.hushlogin < /etc/motd
    echo -n "Press Enter to continue: " && $<
  endif

If you are using sh, ksh, or bash, you need to put the following lines in your .profile (or .bash_profile for bash):

  cmp -s $HOME/.hushlogin /etc/motd
  if [ $? != 0 ]; then
    tee $HOME/.hushlogin < /etc/motd
    echo -n "Press Enter to continue: " && read ans
  fi

These lines compare the current banner with the one you saw the last time you logged in (as saved in your .hushlogin file). If they differ, you'll see the updated banner and be prompted to press the Enter key to continue.

At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.

This is document acdd in the Knowledge Base.
Last modified on 2023-07-24 11:09:38.