It would be great to access all my commands run in terminal on OS X so I can review and use as a running reminder sheet.
I'm using Reverse-I-Search prompt, and have updated my .bash_profile to store all of my history as mentioned here on Mactoids: How to search Terminal command history.
-
Start Terminal.
-
Navigate to the Home folder by entering:
cd ~/
-
Create .bash_profile by entering:
touch .bash_profile
-
Now, either edit .bash_profile in your favorite text editor or type this in the Terminal window to automatically open the file in the default TextEdit:
open -e .bash_profile
-
Lastly, add this to the .bash_profile file:
HISTFILESIZE=1000000000 HISTSIZE=1000000
-
Save and exit.
Do you have any ideas how I could access in order to output the terminal command history in OS X?
Best Answer
All of your history is stored in
~/.bash_history
, where bothreverse-i-search
and the up/down keys use. That file is regularly pruned, but if you followed the guide in your link, the.bash_history
file will practically never be pruned.