GKRootWire
AI xAI Publishes Details on Its Grok Web CrawlerAI Why 'Human-in-the-Loop' Might Have It BackwardsDev Tools Modular Ships Mojo 1.0, Marking the Language's Production DebutAI OpenAI's Head of Ethics Exits Less Than a Year Into the JobAI Researchers Show How to Extract Hidden Reasoning from Proprietary LLM APIsAI Nvidia Debuts Nemotron 3.5 Lightning and NeMo Switchyard for Local AI WorkflowsAI xAI Publishes Details on Its Grok Web CrawlerAI Why 'Human-in-the-Loop' Might Have It BackwardsDev Tools Modular Ships Mojo 1.0, Marking the Language's Production DebutAI OpenAI's Head of Ethics Exits Less Than a Year Into the JobAI Researchers Show How to Extract Hidden Reasoning from Proprietary LLM APIsAI Nvidia Debuts Nemotron 3.5 Lightning and NeMo Switchyard for Local AI Workflows
Dev Tools

The Shell's '!' Isn't for Emphasis—It's a Shortcut You're Probably Underusing

A deep dive into bash and zsh's history expansion shows how the exclamation mark can save you from retyping long commands.

Most terminal users know '!!' repeats the last command, but a recent write-up argues that the exclamation mark's full history expansion powers go largely ignored. The shell's '!' operator isn't punctuation for shouting—it's a lazy shortcut for referencing previous commands without retyping them.

The article walks through lesser-known tricks: '!$' grabs the last argument of the previous command, '!^' grabs the first, '!*' grabs all arguments, and '!string' reruns the most recent command starting with that string. You can even combine these with substitution, like '!!:s/old/new/', to fix a typo in your last command without rewriting the whole line.

These features have existed in bash and zsh for decades, inherited from the original C shell, but they're easy to forget since most people rely on up-arrow and tab completion instead.

Why it matters: History expansion is one of those shell features that's invisible until you need it, and knowing it can shave real time off repetitive terminal work like rerunning a build with tweaked flags. It's also a good reminder that shells have deep, often underused feature sets worth revisiting periodically.

Sources: Hacker News