Use a Preceding Space in Terminal to Hide from History

This is a trick to running commands that you don’t want to be saved in your history.

You may want to run a command that isn’t stored in your history. You can do this with a preceding space.

# no preceding space
someCmd --key ABC123

# 98 ...
# 99 someCmd --key ABC123

# with preceding space
anotherCmd --key ABC123
cd ~

# notice `anotherCmd` is missing
# 98 ...
# 99 someCmd --key ABC123
# 100 cd ~

A common scenario may be when using sensitive values a single time (i.e. where you don’t want to take the time to set environment variables).

Let's Connect

Keep Reading

Use a Code Spell Checker

Spell-checking isn't just for documentation.

Mar 01, 2021

Pro Tip: Use “1.” for Every Ordered List Item when Writing Markdown

A quick tip for making ordered lists in markdown easier to write.

May 31, 2022

Run a Single Jest Test

Learn how to run a single test within a file, how to target a series of tests within a file, or how to only target a single file when using Jest.

Jun 04, 2022