Posts

Showing posts from September 30, 2018

Accessing your historical bash commands instantly !

As a tester, you might be testing several systems and each have different commands. A common interface might be the bash shell. How do you get all the previous commands you typed in bash before? Once you close the bash command? I struggled with this for a few days, and even wrote down commands in notepad, so that i can use them later. Later, I wondered how easy my work would become if i could type the first word of my command and i could search through my bash history. The problem Lets say, i used the following command a few days ago to encrypt a file using gpg. $ gpg --encrypt -r < > REGISTER.ABCD.01102018.917.csv   Today, I want to encrypt a new file. I know I used gpg before, but I don't remember the exact syntax.  So I want to type gpg in my command prompt and then use my arrow keys "up" or "down" to search through my bash history. Solution Add the following two lines to your  ~/.inputrc "\e[A": history-searc