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?
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?
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
.
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.