There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Can't remember the name of that one command line tool? Next time, add a comment!

One of my favorite command line tips: you can add ‘comments’ full of keywords to shell commands, which makes searching your command history easier.


<span style="color:#323232;">> obscure-cmd --with-weird-flags -Qdt # searchable comment keywords
</span>

Presumably you’re using something like fzf for history search, but this is still useful without it.

This is especially useful for cli tools with obscure names/flags, or when you can’t remember where a particular log file is.


Some examples from my history:

tail awesomewm logs:


<span style="color:#323232;">tail -f ~/.cache/awesome/logs -n 2000 # tail follow log awesomewm
</span>

fix linux clock drift:


<span style="color:#323232;">sudo ntpd -qg && sudo hwclock --systohc # fix linux clock time drift
</span>

copy ngrok public url to clipboard:


<span style="color:#323232;">curl -s http://localhost:4040/api/tunnels | jq ".tunnels[0].public_url" | tr -d '"' | tr -d 'n' | xclip -selection clipboard -i # fetch ngrok url uri, copy to clipboard
</span>

sign ssh and gpg, then refresh the emacs keychain env:


<span style="color:#323232;">keychain --agents gpg,ssh --eval id_rsa <some-gpg-id> && emacsclient -e '(keychain-refresh-environment)' # sign ssh,gpg password, refresh emacs env
</span>

Another gpg one:


<span style="color:#323232;">git config commit.gpgsign false # disable gpg signing for this repo
</span>

Pacman/pamac commands, like listing orphaned packages:


<span style="color:#323232;">pacman -Qdt # list orphans
</span><span style="color:#323232;">pamac list -o # list orphans
</span>

xprop - super useful for debugging window management, for some reason i can never remember what it’s called:


<span style="color:#323232;">xprop # mouse click window x11 linux describe info client helper whateveritscalled
</span>

Some helpers from my clawe project:


<span style="color:#323232;">bb --config ~/russmatney/clawe/bb.edn -x clawe.sxhkd.bindings/reset-bindings # reset sxhkd bindings
</span><span style="color:#323232;">bb --config ~/russmatney/clawe/bb.edn -x clawe.restart/reload # reload clawe
</span>

Aliases come to mind as well - in some cases that might be a better fit. I like this because it’s so low-lift.

gamma ,
@gamma@programming.dev avatar

One big caveat here: In Zsh (and maybe other shells) you might have to explictly enable comments in interactive sessions:


<span style="color:#323232;">setopt interactivecomments
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines