Be the first to know and get exclusive access to offers by signing up for our mailing list(s).

Subscribe

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.

Subscribe to our All Things Open YouTube channel to get notifications when new videos are available.

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, and Ctrl+R add up to significant time savings across a workday.
  • Know your terminal recovery options. Ctrl+Q unfreezes 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 -e and set -o pipefail to 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

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.

Working on something worth sharing? Write for us.

Contribute to We ❤️ Open Source

Help educate our community by contributing a blog post, tutorial, or how-to.

Two World-class Events

If you didn't make it to All Things AI, check out the event summary, and make plans to join us October 19-20 for All Things Open.

Open Source Meetups

We host some of the most active open source meetups in the U.S. Get more info and RSVP to an upcoming event.