A few well-chosen shortcuts can turn routine console work into something close to art. These are ones worth knowing.
CLI finesse isn’t about knowing every flag. It’s about how your hands move. Watch an engineer who really knows their shell, and you notice something: their fingers barely pause. No scrolling through history, no retyping paths, no visible friction. It looks like muscle memory, but it’s really a handful of shortcuts doing the heavy lifting.
These shortcuts work in bash, zsh, and most modern shells, whether you’re on a Linux jump box, a macOS terminal, or SSH’d into infrastructure.
History and recall
1. Ctrl + R Search history mid-flow
Tap it, type a fragment, and jump straight to the exact command you used last time. Once this sticks, arrow-key archaeology feels medieval.
2. !$ Repeat the last argument
Fix the command, keep the filename. !$ pulls the final argument from the previous line so you are not retyping long paths under pressure.
3. Alt + . Cycle through last arguments
Press it to paste the most recent argument; press again to cycle back through older ones. Great when you need the same host, file, or VLAN name across several commands.
4. !! Rerun without retyping
!! repeats the last command, and sudo !! repeats it with privilege. The shell equivalent of “do that again, but properly.”
5. fc and Ctrl + X, Ctrl + E Edit before you commit
Open the last (or current) command in your editor, make precise fixes, then execute. Perfect for gnarly pipelines or when you realize three flags are buried in the middle.
Once your recall is second nature, smooth movement is what keeps the flow going.
Movement and navigation
6. Ctrl + A / Ctrl + E Jump to start or end
Zip to either end of the line for fast surgical edits. Tiny, but it changes how long commands feel.
7. Ctrl + U / Ctrl + K Delete to start or end
Clean up half-typed paths without torching the whole line. Precise, quick, and calmer than mashing Backspace.
8. pushd / popd Stack your directories
Bounce to a deep path, then pop back exactly where you were. You are buried in /var/log/app/2025/11/11/ and need to check ~/.ssh/config; pushd ~, inspect, then popd to return to the log trench.
Fast recall and navigation mean little if you cannot see clearly what your commands are doing.
Output and inspection
9. grep with context See the clues around the hit
grep -A2 -B2 pattern app.log shows a couple of lines before and after your match. The cause is often hiding just outside the exact line you searched for.
10. less +F Follow logs with scroll-back
Tail in real time, then pause and scroll up when something looks off. It is how you investigate without losing the stream.
11. Redirect both streams Catch everything
command >out.log 2>&1 captures stdout and stderr together. Cronjob failed “silently”? This is how you catch the error and the surrounding context in one place.
12. diff <(cmd1) <(cmd2) Compare live output
Process substitution treats each command’s output like a file. Run diff <(cmd1) <(cmd2) to spot differences without temp files. It feels like a magic trick the first time you see it.
With the fundamentals automatic, these are the gestures that make it look like wizardry.
Power moves
13. Brace expansion Build structures in one move
mkdir -p project/{src,bin,docs} or for i in {01..12}; do …; done. Concise, readable, and habit-forming.
14. xargs with intent Turn lists into action
Feed a clean list into xargs for controlled bulk ops. Use -n to batch, -I{} to position arguments, or -P for parallel speed when the target can handle it.
15. tee Split output without losing it
command | tee run.log | grep ERROR lets you inspect and log at the same time. Useful when you need proof and visibility in one pass.
Mastery in motion
The CLI rewards repetition more than complexity. These shortcuts are not magic, but they remove the small frictions that make console work feel like a chore. Fix a typo with Ctrl+U, pull the last argument with !$, diff two live outputs without touching disk, and the work starts to flow instead of stall.
That’s what people notice. Not that you know obscure syntax, but that you move through problems without hesitation. The commands seem to anticipate you because your hands already know what comes next. It isn’t wizardry. It’s what happens when you are fluent in the shell.
About NetworkTigers

NetworkTigers is the leader in the secondary market for Grade A, seller-refurbished networking equipment. Founded in January 1996 as Andover Consulting Group, the company originally built and re-architected data centers for Fortune 500 firms. Today, NetworkTigers provides consulting and network equipment to global government agencies, Fortune 2000 companies, and healthcare companies. Visit www.networktigers.com
