We ❤️ Open Source
A community education resource
Linux command line tips: HISTCONTROL, frozen screens, and more
Save time and avoid headaches with these bash tips you'll use every day.
Every developer has a handful of bash commands they type without thinking. But how many are wasting keystrokes on things bash can already handle? In his presentation at All Things Open, Vladimir Levijev (aka dimir), a 24-year IT veteran and engineer at Zabbix, shares a collection of command line tips that range from small daily time savers to scripting habits that prevent real headaches.
Most developers spend their days repeating the same commands, then scrolling through history trying to find the one they ran an hour ago. Vladimir starts with a simple fix that most people overlook. Bash has a built-in environment variable called HISTCONTROL that lets you ignore duplicate entries and commands prefixed with a space. Pair that with Ctrl+R for reverse history search and you stop fighting your own terminal.
From there he moves into aliases, the kind of small customizations that compound over time. Setting less to always process color output, configuring ls to sort by modification time so your most recent downloads appear last, and adding verbose flags to rm so you can see exactly what got deleted. None of these are groundbreaking on their own, but stacked together they remove friction from the tasks you do dozens of times a day.
Read more: Stop opening firewall ports and start using identity
Things get more interesting when Vladimir tackles the moments where your terminal stops cooperating. Most developers have experienced a frozen screen and assumed something crashed, when the real culprit was an accidental Ctrl+S. The fix is Ctrl+Q, which resumes output. And when your terminal gets truly garbled, maybe after accidentally running cat on a binary file, the reset command restores everything that clear cannot. These are the kind of tricks you only need once, but when you need them, nothing else works.
The real depth of the talk comes when Vladimir walks through building a bash script from scratch. He starts with the correct shebang, using env to locate bash portably across operating systems instead of hardcoding a path. Then he builds a simple backup script step by step, showing why parameter validation matters, why you should always exit with a non-zero code on failure, and why meaningful error messages save future you from guessing what went wrong. The progression from manual error checking to set -e and set -o pipefail is especially practical for anyone writing scripts that run in CI/CD pipelines or cron jobs.
Key takeaways
- Small bash configurations like
HISTCONTROL, aliases, andCtrl+Radd up to significant time savings across a workday. - Know your terminal recovery options.
Ctrl+Qunfreezes a stopped screen and reset fixes what clear cannot. - Portable, defensive scripting starts with the right shebang, proper parameter checks, and meaningful exit codes. Use
set -eandset -o pipefailto catch failures automatically.
Vladimir covers much more in the full talk, including file attributes, string manipulation without pipes, signal trapping, and a random one-liner that decided who got to travel to India. It is well worth the full watch.
📺 Watch the All Things Open “Extra’s” playlist
More from We Love Open Source
- Is your LLM lying to you?
- You don’t know what you’re actually shipping
- Zero trust Kubernetes: Context over credentials
- How to secure agentic AI with Agent Identity Protocol (AIP)
- Stop opening firewall ports and start using identity
The opinions expressed on this website are those of each author, not of the author's employer or All Things Open/We Love Open Source.