How do folks keep a "cheat sheet" of terminal/konsole commands?

I tend to stash a “cheat sheet” section in my configuration.nix file. It’s handy when you forget commands.

1 Like

I write scripts with short names.

I use a tool to track my shell history https://atuin.sh/

2 Likes

I use tldr… I don’t have any thing custom with it… but it is possible to add your own cheat sheets to it… and I’ve used it before to do this.

1 Like

Periodically I go through .bash_history, sort it, remove duplicate commands, filter cds, lss and other trivial commands, and only keep the interesting ones.

For very clever ones I add a comment at the end of the line.

sysz for systemd, navi or pet is nice, or simply a justfile.

3 Likes

Many people including myself call to a justfile, that is used by Just.

As an example:

alias switch := rebuild

# Rebuild system for HOST
[group('nix')]
rebuild HOST:
    sudo nixos-rebuild switch --flake .#{{HOST}}

Then to run, you execute just rebuild your-hostname.

It saves having to add these as shell aliases the traditional way. You just call to the single file, and it will load all your “recipes”, with support for tab completion.

To run a multi-line commands, you must do some workarounds. See here.

Either way you have to write a config though, right? And those shebang workarounds for justfiles will break across systems. Seems like simply writing a script using trivial build helpers or pkgs.writers would avoid that issue.

I add simple self documenting RUNME.sh’s into my project folders: GitHub - mipmip/RUNME.sh: RUNME.sh is a tiny toolkit for creating bash cli utilities fast, simple and easy.

Thank you for this, it’s the tool I have been looking for.