/

How to avoid recording commands to history in Fish Shell

How to avoid recording commands to history in Fish Shell

In certain situations, you may need to run commands in the shell without having them saved in the shell history. If you are using Fish Shell, which happens to be my default shell, you can accomplish this quite easily. The following steps outline how to achieve this:

  1. Start a new shell instance with the following command:

    1
    fish --private

    This will initiate a new shell session that will not record any commands to the history.

  2. Execute the commands that you do not want to be stored in the history within this new shell session.

  3. Once you have completed running the desired commands, you can exit the shell by typing “exit” or pressing Ctrl+D.

By following these steps, Fish Shell allows you to work with sensitive information or perform tasks without worrying about them being recorded in the shell history.

If you’re interested in learning more about Fish Shell and its fundamentals, I have written an article specifically on Fish Shell basics. I highly recommend Fish Shell due to its simplicity and its focus on providing a hassle-free experience.

tags: [“fish”, “shell”, “command history”]