0

Since the bash_history file saves only the last n commands, I'd like to create a file that has the entire history of all the commands ever entered in the system.

history > textfile.txt

saves the last 1000 commands to a text file. Is there a way to regularly and automatically back up the terminal history to a text file?

karel
  • 114,770

1 Answers1

1

I have a better option, Atuin, which stores your shell history in a SQLite database. You can still use the up arrow and CTRL+R to search your shell history, though.

In addition, Atuin enables synchronised history across multiple computers. So for example, I have a laptop, desktop and server, all with one shared history of commands.

It's pretty awesome. Here's what it looks like when I press CTRL+R. I get a pretty interface to my past history.

Atuin

The sync happens via a server. You can either use the Atuin server, where your commands are encrypted (so they can't see them), or you can run your own Atuin server.

popey
  • 23,667