Operations 11 min read

20 Essential Linux Terminal Tricks to Boost Your Productivity

This article presents a collection of practical Linux command‑line techniques—from tab completion and directory navigation to log monitoring and command chaining—that help both beginners and seasoned users work faster, avoid common pitfalls, and streamline everyday terminal tasks.

Open Source Linux
Open Source Linux
Open Source Linux
20 Essential Linux Terminal Tricks to Boost Your Productivity

1. Use Tab for Auto‑completion

Press the Tab key while typing a command to automatically suggest completions that start with the characters you have entered, saving keystrokes and reducing errors.

2. Switch Back to the Previous Directory

cd -

The cd - command returns you to the last working directory without re‑typing the full path.

3. Return to the Home Directory

cd ~

or simply cd, which is pre‑configured in most modern shells and saves a few keystrokes.

4. List Directory Contents Quickly

ll

On many Linux distributions, ll is an alias for ls -l, providing a detailed listing with less typing.

5. Run Multiple Commands on One Line

command_1; command_2; command_3

Separate commands with a semicolon to execute them sequentially without waiting for each to finish.

6. Run the Next Command Only If the Previous Succeeds

command_1 && command_2

Use && so the second command runs only when the first exits successfully (e.g., sudo apt update && sudo apt upgrade).

7. Search Your Command History

ctrl + r

Press Ctrl + R and type a keyword to perform a reverse search through your Bash history; press Ctrl + C to exit.

8. Unfreeze a Stuck Terminal (Ctrl + S)

In many Unix‑like systems, Ctrl + S pauses output; press Ctrl + Q to resume.

9. Jump to Line Start or End

Ctrl + A   # move to start of line
Ctrl + E   # move to end of line

These shortcuts are especially handy on laptops where Home/End keys may be less accessible.

10. Follow Log Files in Real Time

tail -F linuxidc_log

The -F option follows the file by name and retries if the file is recreated.

11. Read Compressed Logs Without Decompressing

zcat linuxidc_log.zip | more

Use zcat, zless, or zgrep to view gzipped logs directly.

12. Use less to Browse Files

less -N linuxidc.txt
less

provides paging, searching, line numbers, and does not load the entire file into memory.

13. Reuse the Last Argument of the Previous Command

!$

After creating a directory, you can quickly change into it with cd !$. An alternative is Alt + .

14. Repeat the Previous Command with !!

!!

Useful for re‑executing a command with sudo, e.g., sudo !!.

15. Create Aliases to Fix Typos

alias gerp=grep

Define an alias in .bashrc to correct frequent misspellings.

16. Copy and Paste in the Terminal

Select text and right‑click to paste (common in PuTTY).

Select text and middle‑click to paste.

Use Ctrl + Shift + C to copy and Ctrl + Shift + V to paste.

17. Terminate a Running Command

Press Ctrl + C to stop the current process.

18. Empty a File Without Deleting It

> filename

This truncates the file to zero length.

19. Find Files Containing Specific Text

grep -Pri "search_string" path

Search recursively, ignoring case, and display matching file names.

20. Use Help for Any Command

$bc -help

Most commands provide a built‑in help page that explains usage and options.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.