/

How to Remove the \"Last Login...\" Message from the Shell

How to Remove the “Last Login…” Message from the Shell

Are you tired of seeing the “Last login: …” message every time you open your shell? Don’t worry, you can easily remove it. In this blog, we’ll show you how to get rid of this message in both macOS and Linux.

Here’s what the message looks like before removing it:

Before

To remove the “last login: …” information, follow these simple steps:

  1. Open your terminal.

  2. Run the following command:

    1
    touch ~/.hushlogin
  3. That’s it! The command creates a hidden file called .hushlogin in your home directory, which instructs the shell to suppress the “Last login: …” message.

Now, when you open your shell, you won’t see the “Last login: …” message anymore. Here’s what your shell prompt will look like:

After

By using the touch ~/.hushlogin command, you have successfully removed the “Last login: …” message from your shell.

Tags: shell, terminal, macOS, Linux