Wednesday, April 15, 2020

Tweaking history on Linux

The bash history command on Linux systems helps with remembering commands you’ve previously run and repeating those commands without having to retype them.

You could decide, however, that you’d be just as happy to forget that you referenced a dozen man pages, listed your files every 10 minutes or viewed previously run commands by typing “history”. In this post, we’re going to look at how you can get the history command to remember just what you want it to remember and forget commands that are likely to be of little "historic value".

Viewing your command history

To view previously run commands, you simply type “history”. You’ll probably see a long list of commands. The number of commands remembered depends on an environment variable called $HISTSIZE that is set up in your ~/.bashrc file, but there’s nothing stopping you from changing this setting if you want to save more or fewer commands.

To read this article in full, please click here

Thanks to Sandra Henry-Stocker (see source)

No comments:

Post a Comment