Reputation: 4352
If I type history command, I can view only 1000 lines. I want to view more than that. It will be nice If I can view all commands typed between certain dates or months.
Is this possible? If so, how to do this?
Upvotes: 0
Views: 4557
Reputation: 27423
add some commands to .bash_logout to organize your history files
e.g.
today=`date +%y%m%d`
cp .bash_history >.bash_history_$today
echo >.bash_history # to clear out file
However, one problem: .bash_logout doesn't seem to run in a lot of X-based environments. On a ssh account, such as with a virtual server, it works fine.
Upvotes: 0
Reputation: 4128
You want to set the bash variables HISTSIZE
and HISTFILESIZE
in your .bashrc
.
HISTSIZE
determines how many comands are retained in history. HISTFILESIZE
determines how many lines of history are stored in the file in which they are persisted, usually .bash_history
.
Upvotes: 5