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: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

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