10 Linux Terminal Commands So Powerful They Feel Illegal

10 Linux Terminal Commands So Powerful They Feel Illegal

Derrk SamuelSeptember 6, 20268 min read
Some commands feel like cheats the developers forgot to remove. These 10 terminal one-liners compress hours of work into seconds — file surgery, instant servers, time travel for your data, and the one command that saved my entire hard drive.

The Terminal Is a Superpower You Haven't Unlocked

Every Linux user remembers the first command that made them go "wait, that's it?" — the moment the terminal stopped feeling like a barrier and started feeling like a cheat code.

These are the 10 commands that do that. Each one replaces a multi-step GUI workflow with a single line. No scripts, no configuration — paste, run, profit.

A note on safety: two commands below can touch a lot of files at once. Read each explanation before running anything on a system you care about. None of these commands are dangerous on their own — but power demands attention.

“A note on safety: two commands below can touch a lot of files at once. Read each explanation before running anything on a system you care about. None of these commands are dangerous on their own — but power demands attention.”

Share on X

1. history — Your Terminal Remembers Everything

You've run a brilliant one-liner three weeks ago and it's gone from memory. Except it isn't:

history | grep ssh

Instantly lists every SSH command you've ever typed. Combine it with Ctrl + R (reverse search) and you'll never re-type a long command again.

The illegal-level upgrade

!$

That tiny fragment reuses the last argument of your previous command. Created a directory? Now just type cd !$ and you're inside it.


2. python3 -m http.server — Instantly Share Files With Any Device

This one stops conversations. Standing in any folder, run:

python3 -m http.server 8000

Your entire folder is now a website. Anyone on your network can open http://your-ip:8000 in a browser and browse or download your files — phone, tablet, another PC, even a smart TV.

I use it weekly to push files to devices that fight every other transfer method. When you're done, Ctrl + C kills the server.


3. rsync -avh --progress — Copy Files Like a Professional

Drag-and-drop copy has no resume, no verification, and dies on network hiccups. Rsync is what the pros use:

rsync -avh --progress /home/user/projects/ /mnt/backup/projects/

Why it feels illegal:

  • Interrupted? Re-run the same command — it picks up exactly where it stopped
  • Already-copied files are skipped automatically
  • Works over SSH to remote servers the same way
  • Add -n (dry run) to preview what would happen before it does

This is the command that makes backup strategies trivial instead of terrifying.


4. grep -r — Find a Needle in Your Entire System

Looking for where a config setting lives — across thousands of files:

grep -rn "listen 80" /etc/nginx

Searches every file under /etc/nginx, shows the line numbers (-n), and prints each match with its filename. Thirty seconds instead of an afternoon of opening files one by one.

The combo that lands jobs

ps aux | grep nginx

Pipe the process list straight into a search. Instantly see if a service is running, who launched it, and how much memory it eats — in one line.


5. diff -r — See Exactly What Changed Between Two Folders

"Did my edits to the config folder break anything?" There's a command for that:

diff -r /etc/nginx-original/ /etc/nginx/

Walks both directory trees and lists every file that differs. For the surgical version, add -q for a quiet, filenames-only report.

This is how you audit changes, compare backups, and find out what an update silently modified.


6. chmod +x — Make Any File Runnable

You downloaded a script and Linux politely refuses to run it:

chmod +x script.sh
./script.sh

One command, and the file becomes an executable. That's the entire "installation process" for thousands of Linux tools — no installers, no wizards, no registry entries.

The number system (worth 60 seconds to learn)

chmod 755 script.sh
NumberMeaning
7read + write + execute (owner)
5read + execute (group, others)
6read + write, no execute
0no access

755 = owner does everything, everyone else can read and run. It's the standard for scripts and it decodes in your head after a week of use.


7. df -h and du -sh — Stop Guessing Where Your Space Went

Full disk at the worst moment? Two commands, question answered:

df -h

Shows every mounted drive, its total size, used space, and — the part that matters — free space remaining, in human-readable units.

Then find the hog:

du -sh /home/user/* | sort -rh | head -10

This lists the 10 biggest space-eaters in your home folder. My first run found a 40 GB log folder from a crashed backup tool. Windows "Storage Settings" buried that same insight three menus deep.


8. wget + curl — The Internet, From a Black Screen

wget https://example.com/file.iso

That's a download — resumable, scriptable, works over SSH on a headless server across the world. For API work:

curl -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"name": "test"}'

You can test any API, fetch any file, and automate any download — with zero GUI. On a server 3,000 miles away. From your phone.


9. !! — The "Oh Come On" Button

You typed a long command. Permission denied. Your options: retype it, or:

sudo !!

!! expands to your entire previous command, and this runs it as root. It's the most satisfying two-key combination in computing. Every ex-CLI user knows the reflex — fail, sudo !!, go.


10. dd — The One That Saved My Hard Drive

The command that feels most illegal because it bypasses things GUI tools refuse to do — like cloning a dying disk before it dies completely:

sudo dd if=/dev/sdX of=drive-image.iso bs=64K status=progress

if= is the source, of= is the destination, and it copies everything — byte for byte, including data GUI recovery tools can't reach.

⚠️ Handle with respect: dd does exactly what you say with zero confirmation. A typo in of= can overwrite your target drive instantly. Double-check the drive letters with lsblk before you press Enter. This is the one command on this list that deserves genuine caution.

“⚠️ Handle with respect: dd does exactly what you say with zero confirmation. A typo in of= can overwrite your target drive instantly. Double-check the drive letters with lsblk before you press Enter. This is the one command on this list that deserves genuine caution.”

Share on X

Used carefully, it's disk recovery, perfect USB creation, and full-drive cloning in one tool:

lsblk

The Real Secret

Here's what these commands have in common: they compose. Pipe the output of one into another, chain them in scripts, run them over SSH on remote machines — the power multiplies instead of adding.

GoalThe One-Liner
Reuse last command as rootsudo !!
Instant file serverpython3 -m http.server 8000
Find biggest folders`du -sh */
Resumable copyrsync -avh --progress src dest
Search all configsgrep -rn "text" /etc/
Compare foldersdiff -rq folderA folderB
Space reportdf -h
Disk imagedd if=... of=... status=progress

If you spend your days in containers, watching Docker container logs live is this same idea in action — one command, a live window into your server.

Pick one command this week. Use it until it's muscle memory. Then come back for the next one. In a month, the terminal stops being the scary part of Linux and becomes the reason you stay.

D

Derrk Samuel

Web3, crypto, and Linux PC insights — practical guides, security tips, mining setups, blockchain tools, and decentralized tech strategies for techs.

Discussion

Leave a comment

No comments yet. Be the first to start the discussion!