New post: shell tricks that aren't exactly secret, but aren't always taught either.

Split into two sections: what works on any POSIX sh (FreeBSD, OpenBSD, Alpine...) and what's Bash/Zsh-specific. Because not everyone is on Linux with bash as their login shell.

Things like CTRL+W, $_, pushd/popd, fc, set -euo pipefail caveats, and more.

https://blog.hofstede.it/shell-tricks-that-actually-make-life-easier-and-save-your-sanity/

#unix #bash #shell #sysadmin #freebsd #linux #cli

Shell Tricks That Actually Make Life Easier (And Save Your Sanity)

Watch someone backspace 40 characters instead of pressing CTRL+W, and you’ll understand why this list exists. A collection of shell tricks-grouped by what works everywhere and what’s Bash/Zsh-speci...

Larvitz Blog
@Larvitz This is a great post! I had no clue that ctrl-k/u/y worked in a terminal. I've been curious about one thing, and maybe you'll know. I've heard for years that ctrl-w will delete word by word, but I have never been able to get it to work. I SSH into Debian using cmd.exe on Windows. Is there something capturing that particular keystroke? Other commands (alt-b, ctrl-u, etc) work, but ctrl-w never has.