How can I change what's displayed at a login shell?

The text displayed before the login prompt is stored in /etc/issue (there's a related file, /etc/motd, that's displayed after the user logs in, before their shell is started). It's just a normal text file, but it accepts a bunch of escape sequences:

  • \b -- Baudrate of the current line.
  • \d -- Current date.
  • \s -- System name, the name of the operating system.
  • \l -- Name of the current tty line.
  • \m -- Architecture identifier of the machine, eg. i486
  • \n -- Nodename of the machine, also known as the hostname.
  • \o -- Domainname of the machine.
  • \r -- Release number of the OS, eg. 1.1.9.
  • \t -- Current time.
  • \u -- Number of current users logged in.
  • \U -- The string "1 user" or " users" where is the number of current users logged in.
  • \v -- Version of the OS, eg. the build-date etc.

On my machine I have:

This is \n (\s \m \r) \t \l

Which is rendered as:

This is etudes-1 (Linux x86_64 2.6.39-gentoo) 17:43:10 tty1


The OP clearly is asking about messages displayed AFTER log in, all "/etc/issue" are displayed BEFORE login+password is entered so are off-topic.

The 'login shell' steps are:

  1. show messages contained in /etc/issue
  2. ask for user and password
  3. show Message Of The Day from:

    /etc/motd

    /etc/update-motd.d

  4. start /etc/profile and ~/.bash_profile

NB .bashrc is executed for NON-login shell

@Naftuli Kay add your ASCII art to /etc/motd you can also put a script in /etc/update-motd.d; for user independent prints the script can go in /etc/profile. ~/.bash_profile for single user prints


The file /etc/issue and /etc/issue.net are the files displayed by the login program. You can put special expansion characters in it, as noted on the other answer. But you may also want to try the linux_logo program. It can generate really nice ASCII art issue files for you.