No shell history at all

I was a bit miffed when shells started saving history to disk (and even moreso when I discovered BSD process accounting). It turns out several people here on Gemini are getting into shell history techniques and sharing tips:

A brief history

A briefer history

Over the years I've changed how I used shell history. But recently I've switched to Simon Tatham's policy of no history. It's not just about the risk of getting hacked (in which case one must also be worried about application-specific history like .lessrc) but about not *relying* on transient data being there unintentionally:

Policy of Transience (sgt20)

The history features of UNIX shells such as bash are not particularly "discoverable". It was years before I learnt about ^R to search back through the recent commands. There seem to be at least the following:

The downside of the no-history tradeoff is that shell history when it gets long enough is a statistical source of information about potential automation: if you're typing the same command lots of times, that may be a clue that you should set up an alias or save the command as a script with proper documentation and version control. My technique for capturing these was this tiny shell function, which is still in my ~/.alias:

This would tell me my most often used shell commands, which was a fruitful source of time-saving automations. I commend it to the house.

Gemlog index

Site index

Proxied content from gemini://gemini.ucant.org:1965/gemlog/2025-08-07_no-shell-history-at-all.gmi (external content)

Gemini request details:

Original URL
gemini://gemini.ucant.org:1965/gemlog/2025-08-07_no-shell-history-at-all.gmi
Status code
Success
Meta
text/gemini
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.