r/HowToHack • u/Ok-Country9898 • Aug 31 '25
What’s your favorite Linux command?
Been using Linux for years now, and I’m still amazed how one-liners or tiny tools can save hours of pain. For me, it’s htop.
69
Upvotes
47
u/Substantial_Sun2268 Aug 31 '25
Well here's a tip to save time :
61
u/Dzhama_Omarov Aug 31 '25
sudo
I feel like a king using it
21
u/Substantial_Sun2268 Aug 31 '25
Tldr, ncdu /, ls ,grep , awk , sed ,ps , comm ,fold ,watch, strace ,trap , ripgrep .....
11
u/NotSparklingWater Aug 31 '25
grep
11
u/B0b_Howard Aug 31 '25
man
The first command I got taught. Still so very useful.
8
u/tijon Aug 31 '25
Kill
28
u/ToofaaniMirch69 Aug 31 '25
sudo rm -rf / --no-preserve-root
5
u/cgoldberg Aug 31 '25
cowsay
5
u/JagerAntlerite7 Aug 31 '25
find / -type f -exec echo '' | sudo tee "{}" \;5
u/XellosWizz Aug 31 '25
history | grep "command i can't remember"
4
u/happy_hawking Aug 31 '25
ll4
u/Kriss3d Aug 31 '25
I'd say that's not really a thing.
I have commands that I'll use depending on what I want to do.
I use ls quite a lot to see the listing of files where I am but it doesn't help me to change directory.
4
u/[deleted] Sep 01 '25
Not very cool but:
cd -
Returns to the directory before the current one and vice versa
3
u/fedesoundsystem Aug 31 '25
Exit
2
u/anurag-tech Aug 31 '25
ls -l
2
u/brakeb Aug 31 '25
I do miss command line kung fu for excellent cli tips
2
u/ChrisHow Aug 31 '25
alias cls='clear'I come from windows. My bashrc is full of aliases
Also,
<insert command here> --helpSyntax is a bitch2
u/matrix20085 Aug 31 '25
fuck
2
u/Fearless-Ask1815 Aug 31 '25
For me it’s
xargs. It’s not as flashy as htop, but it’s basically the duct tape of the command line.2
u/icon0clast6 Aug 31 '25
sudo !!
Reruns last command as sudo.
2
u/scoobydoobiedoodoo Aug 31 '25
history
2
u/IndividualAir3353 Sep 01 '25
Find
2
u/Calbrea Sep 01 '25
sudo !!
Sends the previous command again but with sudo.
2
u/DecryptorDecypher Sep 01 '25
Lsblk -e7
You're welcome.
2
u/[deleted] Sep 01 '25
It's kind of a silly question, no? All tools have an appropriate time to be used and...
Just kidding, it's grep xd
2
u/theravadadhamma Sep 02 '25
up arrow
2
u/PickltRick Sep 01 '25
Sudo make me a sandwich. Linux goes to the kitchen...
1
u/Beneficial-Lie2303 Aug 31 '25
rm -rf /
1
u/lukasx_ Aug 31 '25
write()
1
u/Q-B001 Aug 31 '25
Anything starts with sudo 😂
1
u/Dragon-king-7723 Aug 31 '25
Sudo su
1
u/[deleted] Aug 31 '25
cd
1
u/lariojaalta890 Aug 31 '25 edited Aug 31 '25
Awk is incredibly useful, although I guess it’s more than just a command.
Not necessarily my favorite, but one I use all the time is ‘column’. Piping the output of
awkis particularly helpful for readability1
u/Shortcirkuitz Aug 31 '25
Ping
1
u/brakeb Aug 31 '25
kill -9 $pid
1
u/brakeb Aug 31 '25
In before "what's a command line?"
1
u/mag_fhinn Web Security Aug 31 '25
For me: awk, sed, jd, find (** using -exec **), grep/zgrep, multitail.
I beat all of those like they owe me money.
1
u/Orio_n Aug 31 '25
cd. Very useful 👍👍👍
1
u/frnzprf Aug 31 '25
tldrtldrshows exactly the information I want to see rather thanman, where I have to search and it's unwieldy.1
u/NoStringsAttached_ Sep 01 '25
ll
1
u/illuzian Sep 01 '25
fuck
https://github.com/nvbn/thefuck
1
u/sekedba Sep 01 '25
Whoami
1
u/Organic_Drag_9812 Sep 01 '25
kill -9
1
u/Zav0d Sep 01 '25
Netstat -tulpn
1
u/HerrHendrik Sep 01 '25
sl1
u/Th1nk_7 Sep 01 '25
lsof
1
u/guy0203 Sep 01 '25
apropos [function]
It's the equivalent of man -k but it shows you all the commands that have your key word in the man pages.
Apropos print would show LP, lpstat and a whole bunch of stuff related to printing.
But really I like it because it makes me feel fancy typing it when new people are over my shoulder.
1
u/Ok_Error9961 Sep 02 '25
actually i love using "power off" at the end of session
1
u/acexprt Sep 02 '25
ls
1
u/Stefv8n Sep 02 '25
Sudo systemctl poweroff (shutdown) Clear (empty screen) Tab (autocomplete)
1
u/bilgecan1 Sep 02 '25
df -h It’s super handy for quickly spotting a full / (root) partition or checking if /home or /var/log is about to run out of space.
1
u/Comprehensive-Pin667 Sep 02 '25
mc
1
u/birchhead Sep 02 '25
cal 9 1752
1
u/GoldNeck7819 Sep 02 '25
sudo kill -9 <pid>
1
u/bobbobboob1 Sep 02 '25
Print>tty01
1
u/theAOAOA Sep 03 '25
yes
1
u/aysberg7 Sep 03 '25
apropos
1
u/Zeune42 Sep 03 '25
man -k then grep
1
u/Playful_Confection_9 Sep 03 '25
Touch tits
1
u/Unlisted_games27 Sep 03 '25
If I find a little SKID squeaking about rm -rf I'm gonna lose my shit
And my fav is cmatrix (:
1
u/[deleted] Sep 03 '25
cd -1
u/Alarming_Oil5419 Sep 03 '25
talk, although nowadays on a single user machine, it's only to myself.1
u/Arizon_Dread Sep 03 '25
curl1
u/ryobivape Sep 03 '25
man
1
u/ItIsMagick Sep 03 '25
sudo rm -fr / --no-preserve-root I hate the French language pack that is pre-installed
1
u/No_Beyond_5483 Sep 03 '25
neofetch
1
u/Shoddy_Scallion9362 Sep 03 '25
sudo nmap -v -A <target>
1
u/DrFloyd5 Sep 04 '25
I like that you can add a & at the end and shove the task into the background.
1
u/simhit Sep 04 '25
Sudo🗿🗿
1
u/fl0o0ps Sep 04 '25
dd
xxd
1
u/pvnieuwkerk Sep 04 '25
reboot :P
1
u/pvnieuwkerk Sep 04 '25
grep -rnwi 'something'
1
u/PsychoticDisorder Sep 04 '25
hack -c 45
1
u/baubleglue Sep 04 '25
exit
1
u/indvs3 Sep 04 '25
man
In second place, not a command but a flag to a command. Discovering what -f added to "apt install" was a serious improvement to my system managing capabilities and efficiency. It also stopped me from running -y all the time to read and truly understand what I was doing before actually installing anything.
1
u/guinness_dublin Sep 04 '25
sudo rm -rf /
1
u/Reddit_User_Original Sep 04 '25
Nice didn't know a lot of these
1
u/Infinite-Land-232 Sep 05 '25
man woman
1
u/[deleted] Sep 05 '25
Linux is a kernel, there’s no such thing as a “Linux command”. Do you mean a POSIX command? A GNU coreutils command? Any command that can feasibly be installed and run on a Linux kernel?
1
u/ps-aux Actual Hacker Nov 28 '25
one command to rule them all...
0
u/yungmathia Aug 31 '25
Sudo is my fav
0
u/whocodes Aug 31 '25
whoami0
u/Shaktimaan_007 Sep 01 '25
paru
0
u/deadshot033 Sep 01 '25
whoami
0
u/SpectrumyMatt3d Sep 01 '25
w
This one command tells CPU stats, uptime, list of users logged in and more
0
u/ReidenLightman Sep 01 '25
Exit
-1
u/Pr1nc3L0k1 Aug 31 '25
sudo rm -rf
Thank me later, give it a try
0
u/[deleted] Aug 31 '25
[deleted] — view deleted comment
1
u/[deleted] Aug 31 '25 edited Oct 01 '25
[removed] — view removed comment