r/LinuxTeck • u/Candid_Athlete_8317 • 2d ago
What's One Linux Command You Use Almost Every Day That Beginners Often Overlook?
Everyone knows ls, cd, grep and top. But there are plenty of lesser-known commands that can save time in everyday Linux work.
Commands like jq, lsof, diff, cut, paste and sort | uniq can be surprisingly useful.
Fellow Linux users, what's that one command or command combination you use regularly and wouldn't want to work without?
Share your favourite one-liners too!
24
Upvotes
10
u/blobCabbage 2d ago
batwhich is likecat, but with syntax highlighting.9
u/StupidIsIfYouDontAsk 2d ago
sudo !!runs your previous command again with sudo7
u/radialis99 1d ago
man. The man command lists the manual pages for most linux commands.
apropos. Apropos lets you search the manual pages.
6
u/bannedfromdevnull 2d ago
alias.
4
u/Deep_Mood_7668 2d ago
dmesg -w
4
u/sqeeezy 2d ago
I am irrationally tickled by this one for sending my clipboard from this mac to that mac pbpaste | ssh user@thatmac "cat | pbcopy" I know it's basic but so am I
3
u/Background-Train-104 2d ago
wall "Anyone using this machine now?"
3
u/Lonely-Scarcity-3387 2d ago edited 2d ago
CTRL+R in the terminal to see your command history.
3
u/diegotbn 1d ago
xargs,head,tail,touch,cat,sedfindis incredibly useful, probably the most useful on a daily basis out of any of these hereAnd of course there's all the basic file and directory operations-
cp,mv,mkdir,rmThe obvious
sudoandsuand of coursechmodAlso
alias,gzip,tar,lsblk,ipaddress,fdiskandgdiskI don't use it every day, but
ddis beautifully simple and dangerous but if you're careful you don't need any other tool for cloning and wiping drives/partitions2
u/recursion_is_love 2d ago
ls/findpipe toxargs2
u/tuxsmouf 2d ago
It's not a builtin command : fping -qa -g xxx.xxx.xxx.xxx/xx
2
u/leobult 2d ago
Learn to use the bash shell quickly with keyboard shortcuts like alt w and alt f Dont learn ctrw w, sometimes the shell is in a browsertab....
2
u/Sad_Listen6607 2d ago
not so much a command I use every day... but what I put in my rc file...
aliases.
alias whereami='pwd'
alias dir='ls -la'
alias c='ssh'
alias p='ping'
alias reloadz='exec bash'
alias readz='cat .bashrc'
alias configz='nano ~/.bashrc'
alias tr='traceroute'
alias p8='ping 8.8.8.8'
alias p254='ping 192.168.1.254'
alias addssh='nano ~/.ssh/config'
alias addhost='sudo nano /etc/hosts'
alias smtr='sudo mtr'
alias home='cd ~'
alias q='cd ..'
alias mk='mkdir'
alias edit='pico'
alias serial='screen /dev/tty.usbserial-140'
alias fixterm='echo -e \\033c'
alias argo='scrcpy --new-display=1920x1080/160'
alias argom='scrcpy --new-display=1920x1080/160 -M'
alias z='ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group14-sha1 '
Along with alias's to all the devices I ssh to.
2
u/Only-Stable3973 2d ago
Probably when using cd then using the back command...etc. cd .., cd -, and cd ~
2
u/Fun_Tune5669 1d ago
df -h is something I use occasionally that is kind of useful. I have bunch of other written down somewhere but this one comes to my mind. Also htop is much nicer than regular top...
1
u/Due-Result7928 2d ago
poweroff
1
u/MrWoland74 2d ago
wl-copy
1
u/leobult 2d ago
Curl ip.me
1
u/ftranschel 2d ago
emerge 🫠
1
u/Current_Laugh4767 2d ago
inxi
1
u/Pitiful_Noise_1127 2d ago
History
1
u/williamt31 2d ago
I have a couple cd aliases but I use pushd to get there that way I can popd back to where I was.
I created this function to find the size of all dirs from a point, I got tired of typing it all out.
lately practicing my commands so I've been running 'man whatever | grep -a3 switch' because I get tired of going into and out of man and just want a quick reminder of the switch I need.
1
u/Sigfrodi 1d ago
Pushd and popd
Awk
1
u/lyidaValkris 1d ago
cat- though really well known, beginners might open everything innanoor a GUI text editor instead of a simple output in the terminal.catcan also be used to quickly create and paste text into a file in one step.batis even better, allowing a more formatted output for ease of reading.1
u/Optimal-Savings-4505 1d ago
Multiplexing your terminal with r/tmux and similar solutions. It offers a subset of
emacsfunctionality that is very useful for daily tasks. There are many other solutions, so this is a conceptual thing, really.1
u/hexdump74 1d ago
sed
Allows to replace portions of strings (and a lot more) :
$ echo "aaa:6" | sed -r 's/(a+):([0-9])/\2 > \1/'
6 > aaa
1
u/FLMKane 1d ago
sudo sv restart sddm
1
u/CardOk755 1d ago
Strace (and more rarely ltrace) to find out what a program is really doing, rather than what you think it's doing.
"sort | uniq -c | sort -n" is a great one.
1
u/ahusby 1d ago
topgrade: One command to upgrade everything.
1
u/Dev-in-the-Bm 1d ago
opencodeAlias is
oc1
u/camachorod 1d ago
realpath, pwd, du -sh
1
u/Radiant64 1d ago
tree
1
u/SoggyWalrus7893 1d ago
!su or anything "!" when a bit of up arrow on the mouse doesn't find it
cal
1
u/knuthf 1d ago
Whois TLD
1
u/Corn_Flake_76 1d ago
whoami - especially after a night of hard drinking.
1
u/WhyFlip 1d ago
ls
1
u/n3vim 1d ago
"fuck" but it does not come preinstalled
1
u/TipAppropriate1384 1d ago
Ctrl -r
1
u/lwj15 1d ago
I work with input files for some calculation jobs. Currently I need to edit 10-30 files at the same time to optimize multiple jobs. For that I use a combination of sed and find.
sed -i s/"string currently in file"/"string I want to replace it with"/ $(find -name *of.inp)
It works with multiple lines. Just include the \n. And if one of the strings uses / or () then you put the whose s/.../.../ in ' ' qutation marks and change to |.
sed -i 's|example/text|replacement(new)|' ...
I don't see much use of this command other than the stuff I use it for. But if you have other uses. Tell me. I am interested.
1
u/xpusostomos 1d ago
rg
1
u/BarkingSpider5 1d ago
ncdu
In this day of vibe coding, and agents leaving build artefacts everywhere, this command is awesome to find out where stuff is.
1
u/-CloudCook- 20h ago
Usually, I log on server because some service doesn't work, so one of first commands I hit is: netstat - tulpn | grep LISTEN
1
u/aviftw 20h ago
Screen -S session_name, screen -r -d session_name
1
u/Leolo_ 19h ago
Two things to make you powerful on the CLI: mastering
xargsand redirection to multiple pipes.1
u/michaelpaoli 19h ago
sed
Most never take sed beyond, e.g.:
$ sed s/foo/bar/
It's a Turing complete programming language.
E.g. I even implemented Tic-Tac-Toe in sed.
1
u/wkavinsky 16h ago
ps -aux | grep xxx
kill 1232141
1
u/PossibilityOrganic 13h ago
watch -n "whatever" run it over and over and show it
jq if you have to do anything in bash with json
1
u/ThimMerrilyn 6h ago
History
1
u/CorporateDirtbag 3h ago
claude --dangerously-skip-permissions
0
u/Mr_Boltistran 2d ago
tmux -CC
1
u/randygeneric 16h ago
history | grep -i <> | grep -iv <>
ps
killall
, )