Mac Terminal Find Command History


There are multiple ways to get to the past history in the Mac Terminal application.

The easiest and quickest way to get to recent history is by pressing the up ↑ and the down ↓ arrow keys on your keyboard.

Mac Terminal History Navigation using Up or Down Arrows

But if you want to see a list of all the recent commands that you have executed on the Terminal, then you have to make use of the history command.

history

  971  lftp 192.167.0.1
  974  lftp ftp://ftp.code2care.org
  975  ping code2care.org
  980  ls
  981  who
  982  clear
  983  ls -ltrh
  986  history | grep who

Mac History Command Example

As you can see, you can pipe the history command with grep to filter out the specific command that you are looking for.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap