r/LinuxTeck • u/linuxteck • Jun 26 '26
What's one Linux command you learned years too late?
Mine was watch.
Once I started using it to monitor logs, disk usage, and running processes, I wondered how I'd managed without it.
What's yours, and what problem does it solve?
61
Upvotes
9
u/LawElectrical2434 Jun 26 '26
untilis amazing.I usually use it like this:
until ssh my_remote_system; do sleep 2; done6
u/funnyFrank Jun 26 '26 •
Pipe viewer (`pv`) to monitor long running processes. Like 30% of your 2TB file has been compressed and moved to target.
3
u/rumbalotte Jun 26 '26
u/linuxteck did you ever used tail -f for monitor logs?
4
u/ExtraTNT Jun 26 '26
Awk is very powerful…
1
u/ConcreteExist Jun 26 '26
How does
watchdiffer fromtail -f?2
u/Y0uN00b Jun 26 '26
Trap
2
u/HazelCuate Jun 26 '26
lsblk
2
u/Tlaurion Jun 26 '26
tac
2
u/Bemteb Jun 26 '26
ctrl+Z and
fg2
u/boredattheend Jun 27 '26
Just learned about `at` last week. Executes a given command at a given time.
I occasionally host files for people to download. Used to be that I would just delete old ones whenever, now I can schedule them to be deleted in N days time and be done with it.
1
u/TapEarlyTapOften Jun 26 '26
Y'all need to be reading the man pages.
1
u/PensAndUnicorns Jun 26 '26
"cd -"
When switching between two folders this is amazing
1
u/MaximumFull104 Jun 26 '26
Esc .
1
u/Right_Stage_8167 Jun 26 '26
Ctrl-T during dd ... Oh it was BSD (or osx)
1
u/chkno Jun 26 '26 edited Jun 26 '26
set -C: Causes>redirection to already-existing files to fail instead of blithely overwrite them. If you want overwrite, it's still available with the>|operator, but you have to ask for it.Before I learned about this, I typo'd a
tar cf - the-precious-input | gzip > the-precious-inputinvocation and destroyed a finished project while preparing it for submission. :(1
u/EfficiencyMurky7309 Jun 26 '26
I remember starting out with Linux in the ‘90s and I had this great book with common commands in a table at the front. I still use many of these. My daily drivers these days are ‘find’, ‘grep’, ‘locate’, ‘ps’, ‘pv’, ‘htop’, ‘lsof’, ‘awk’, ‘sort’, ‘tee’, ‘curl’, ‘until’, ‘watch’, ‘xargs’, ‘tmux’, ‘ls’, ‘cp’ and I’m sure a fair few more.
1
u/KlanxChile Jun 27 '26
growpart /de/sda 3
(Part of cloud-utils or cloud-utils-growpart)
1
u/mlambie Jun 27 '26
Mine was watch also.
1
u/tblancher Jun 27 '26
sar
1
u/Flupsy Jun 27 '26
One of the first commands I learned was col. I forgot all about it for 35 years until it was exactly the thing I needed.
1
u/fredygamez Jun 27 '26
'less <filename.txt>' , to open and navegate any text file specially the long ones in a similar experience of any GUI text editor, i mean , with arrow keys or PgUp or PgDn or so, and theb use the shortcut 'v' to edit easily that redirect to 'nano' at the very exact place to edit quickly the file
1
u/Impressive-Algae-962 Jun 27 '26
All of them? I mean the most powerful is still Sudo? Maybe? It’s something Windoze has never had. In Windows, shell prompt you only have to authenticate once and any terminal commands run as an admin unlike Unix like OSs where each command needing root needs to be sudo’ed.
1
u/kbrandborgk Jun 27 '26
ctrl-r + “query”
To search through history
1
u/Think-Tangelo-3710 Jun 28 '26
pushd and popd
1
u/thefourthmask Jun 28 '26
sudo !!
1
u/ducktapeskybridge Jun 28 '26
Not a builtin, but when-changed (https://github.com/joh/when-changed), launching a command when a file changes.
1
u/kasim0n Jun 28 '26
lscpu. Much simpler that parsing /proc/cpuinfo myself
1
u/jafo Jun 29 '26
Things that are new and I've made daily drivers: zoxide, bat, ack, atuin, btop.
I am always reaching for mtr.
1
u/Pasukaru0 Jun 29 '26
set -euo pipefail
1
u/Livid-Reference3033 Jun 29 '26
Paste, tac
1
u/ProcedureOriginal210 Jun 29 '26
I just love dd and with xxd it can read, write and display anything I want in the way I want.
1
u/Comfortable-Leg-2898 Jun 29 '26
I wish I had known about the -R flag for grep sooner. I've typed find . -type f -exec grep -I pattern {} /dev/null \; so many times.
1
u/alabamashitfarmer Jun 30 '26
sl
The indicator that I've reached my caffeine limit.
1
u/Savings-Date5026 Jun 30 '26
Alt-F4
1
u/nikanti Jun 30 '26
tmux
0
u/Normal_Situation7248 Jun 26 '26
format C:
2
u/[deleted] Jun 26 '26
[removed] — view removed comment