20 Essential Linux Terminal Tricks to Boost Your Productivity
This guide presents twenty practical Linux command‑line shortcuts—from tab completion and directory navigation to history search and log monitoring—that help both beginners and seasoned users work faster, avoid common pitfalls, and streamline everyday terminal tasks.
In this article the author shares a collection of twenty Linux terminal shortcuts designed to save time and improve workflow for users of any skill level.
1. Tab completion
Press Tab while typing a command or filename to auto‑complete the rest of the word based on the current input.
2. Return to previous directory
cd -The cd - command switches back to the last working directory without re‑typing the full path.
3. Jump to home directory
cd ~or simply cd, which is pre‑configured in most modern shells.
4. List directory contents quickly
Instead of ls -l, many distributions provide the ll alias for a detailed listing.
5. Run multiple commands in one line
command_1; command_2; command_3Separate commands with a semicolon to execute them sequentially without waiting for each to finish.
6. Conditional chaining (run next only if previous succeeds)
command_1 && command_2Typical use: sudo apt update && sudo apt upgrade.
7. Reverse search command history
Press Ctrl + R and type a keyword to search previously entered commands.
8. Unfreeze a terminal stopped by Ctrl+S
Press Ctrl+Q to resume output.
9. Jump to line start or end
Use Ctrl+A for the beginning and Ctrl+E for the end of the current line.
10. Follow a log file in real time
tail -F linuxidc_logThis is equivalent to --follow=name --retry, continuing after file rotation.
11. View compressed logs without extracting
zcat linuxidc_log.zip | moreCommands like zless, zcat, and zgrep operate directly on gzip files.
12. Use less for large files
less -N linuxidc.txt lessprovides paging, searching, line numbers, and optional editing with v.
13. Reuse the last argument of the previous command
!$Useful after creating a directory: mkdir newdir && cd !$.
14. Repeat the previous command
!!Combine with sudo to quickly rerun a command with elevated privileges.
15. Create aliases to fix typos
alias gerp=grepNow typing gerp runs grep automatically.
16. Copy‑paste shortcuts in terminals
Select text and right‑click to paste (PuTTY, many Windows SSH clients).
Select text and middle‑click to paste. Ctrl+Shift+C to copy, Ctrl+Shift+V to paste.
17. Abort a running command
Press Ctrl+C to terminate the current process.
18. Empty a file without deleting it
> filename19. Search for a string inside files
grep -Pri "search_string" path20. Access command‑specific help
$ bc -helpNearly every command provides a built‑in help page that explains its usage and options.
These tips work on most Linux distributions and shells without requiring additional tools.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
