Remove the “Last login” Message from the Terminal

Jun 22, 2010 - 3 Comments

Terminal in OS X When you launch a new Terminal window or tab in Mac OS X (and most linux distributions) you’ll be greeted with a little message, either some “last login” details, or maybe even a message from the admin from /etc/motd. The last login details are default in a new OS X terminal session, whereas the Message Of The Day is from a custom adjustment set by the sysadmin or yourself.

If you’d like to change or remove that “Last Login” message, you can do so rather easily by turning to the command line and creating a modifier file. This will override whatever the login message is in Terminal app, effectively disabling it for the user account where it’s put in place.

To be clear, with the default Last Login message on the Mac, the screen output typically looks something like this when you launch a new window:

Last login: Tue Jun 22 10:59:29 on ttys003
Macintosh:~ user$

How to Disable the “Last Login” / MOTD on New Terminal Session

If you don’t want to see that login message or MOTD again, you can get rid of that ‘Last login’ message at the top of a new terminal by entering the following command to create a ‘hushlogin’ file:

touch .hushlogin

Generally you’ll want to put that file into a users home directory. The existence of the file is enough to silence the MOTD and login message.

Now when you launch a new terminal you won’t see the message, changes take effect immediately.

Note that having a .hushlogin file in the users home directory will also mute the /etc/motd file from executing. If you’re having problems with that executing, just proceed the file with a directive:

touch ~/.hushlogin

If you’re a root user you can create the files into other user directories as well:

touch /Users/NAME/.hushlogin

Recall that the ‘touch’ command creates a blank file of the provided name.

Terminal in OS X

If you want to reverse this and get the last login or MOTD back again, all you have to do is remove the ‘touched’ .hushlogin file, by entering the following command:

rm .hushlogin

If you want to, you can create a custom MOTD with whatever message you want that will be displayed instead. That can literally be anything, from a simple hello, to a to-do list, to calendars, ASCII art, to many other things. Many systems administrators have fun with the MOTD file, and you can too. You can even use scripts to provide randomized quotes or advice for the motd as well, though that’s a topic for another article.

Have anything fun or interesting in your MOTD? Let us know in the comments!

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Bill Ellis in Command Line, Mac OS X


» Comments RSS Feed

  1. jonathan clairembault says:

    Good trick but you better use:
    touch ~/.hushlogin
    rm ~/.hushlogin


  2. gibatronic says:

    it only works for new windows.
    is there a way to make it work for new tabs too?

  3. DAN THE MAN says:

    Thanks for this amazing article, now I know where to enter the following command. If you are going to write an article then write it just like this, it’s that helpful. Now my MOTD has changed, awesome, I am a terminal expert.

Leave a Reply


Shop for Apple & Mac Deals on

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates