Link to home
Start Free TrialLog in
Avatar of Christopher Schene
Christopher ScheneFlag for United States of America

asked on

How do I make the history command on MAC display all stored command history

I specify my history file size as 10000 but when I type "history" on the MAC iterm command line I only see the last 500 command entries.

How do I show all 10,000?

Extract from my .bash_profile:

export CATALINA_HOME=/Library/Tomcat/apache-tomcat-8.0.9
export CATALINA_BASE=/Library/Tomcat/apache-tomcat-8.0.9
HISTFILESIZE=10000
alias ll="ls -ltr"
alias d=date
alias h=history
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

cat ~/.bash_history

or

history 10000

or change your alias:

alias "h=history ${HISTFILESIZE}"
Avatar of Christopher Schene

ASKER

Hmmm, when I tried it I still see the same thing (500 lines)

cschene-v1:~ cschene$ wc -l /Users/cschene/.bash_history
    7868 /Users/cschene/.bash_history
cschene-v1:~ cschene$ history 7868 | wc -l
     500
cschene-v1:~ cschene$
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That works!

Thanks!