Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 844 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 844 Bytes

Bash Eternal History

Installation

Clone or download somewhere and source bash-eternal-history.sh on your ~/.bashrc. This is a possible way to do it:

$ git clone [email protected]:ateijelo/bash-eternal-history.git
$ cd bash-eternal-history
$ echo "source \"$PWD/bash-eternal-history.sh\"" >> ~/.bashrc

Usage

After installation, you just need to start a new shell and every command will be logged twice to ~/.bash_eternal_history, one time before running the command and a second time after the command is done.

This is useful to investigate how long a command took to complete. If you'd rather have it logged once, check the variables at the beginning of the code.

I also added the following function to my ~/.bashrc, to perform searches:

function bh()
{
    grep -a "$@" ~/.bash_eternal_history
}