Skip to content

Hiding from history on Linux

Linux shells like bash have a convenient way of remembering commands that you type, making it easy to run them again without having to retype them. Just use the history command (which is a bash built-in) and then use an exclamation point followed by the number shown in front of the command in the history command output that you want to rerun. Alternatively, you can back up to that command by pressing the up arrow key as many times as needed to reach that command and then press return. Don’t forget, though, that you can also set up commands you are likely to use often as aliases by adding a line like this to your ~/.bashrc file so that you don’t need to search for them in your command history. Here’s an example:

To read this article in full, please click here

Source:: Network World – Data Center