Centralise Your Bash History



Have you ever run a command on one of your hosts and then wanted to retrieve it later? Then couldn’t remember where you ran it, or it’s lost from your history?

This happens to me all the time. The other day I was hunting for a command I was convinced I’d run, but wasn’t sure where it was or whether it was stored.

So I finally wrote a service that records my every command centrally.

Here’s an overview of its (simple) architecture.




This stores your bash history on a server in a file.

The service runs on a port of your choosing, and if you have some lines in your ~.bashrc file then it will all work seamlessly for you.

There’s some basic authentication (shared key) to prevent abuse of the service.


To set up, see the README.


Needs socat installed, and bash version 4+.

Related posts

Ten Things About Bash
Ten More Things About Bash


I need help to improve this – see the README.


If you ask nicely I might host it for you, without warranty etc..


If you want to learn more about bash, read my book Learn Bash the Hard Way, available at $5: