Book Image

Penetration Testing with the Bash shell

By : Keith Harald Esrick Makan
Book Image

Penetration Testing with the Bash shell

By: Keith Harald Esrick Makan

Overview of this book

Table of Contents (13 chapters)

Customizing the command history


Often, during a penetration test or whenever you're using some pretty lengthy command lines to accomplish your tasks, you may want to reuse them quite often or recall them for future use. Making sure that your terminal records the correct details about your commands and—more importantly—records enough of them is an important modification.

As with other topics discussed, there's of course a main page dedicated to customizing command history behavior. You can reach this man page by executing the following command:

man bash 

Look for the section that mentions the HISTORY variable and those associated to it.

Of course, like most other components and functions of the bash terminal, you have quite a bit of say in how things get done when it comes to command logging. These environment variables that control what gets logged and how are discussed as follows:

  • HISTSIZE: This controls the number of commands that are initialized to the history.

  • HISTFILE: This specifies...