Remove the “Last login” Message from the Terminal

Jun 22, 2010 - 2 Comments

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 screen output typically looks something like this:

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

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

touch .hushlogin

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

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.

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

2 Comments

» Comments RSS Feed

  1. jonathan clairembault says:

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

    Cheers

  2. gibatronic says:

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

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

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