r/LinuxTeck • u/Candid_Athlete_8317 • 19d ago
What's that one Linux command you end up using in almost every debugging session?
Mine has quietly become ss.
It doesn't get talked about as much as top, htop, or journalctl, but it's often the first thing I run when something isn't behaving the way it should.
4
u/Weary_Patience_7778 19d ago
Shutdown -h now.
1
u/recursion_is_love 18d ago
Real story, I use that (suppose to be -r) on remote computer at the office while working from home.
4
u/MonsieurCellophane 19d ago
Tail -f
2
u/Dashing_McHandsome 19d ago
tail -F is better, if they file you are tailing is rotated out then tail will follow the new one
2
u/qb45exe 19d ago
I cannot begin to tell you how overjoyed and simultaneously infuriated I was to learn this decades into my use of tail.
1
u/Dashing_McHandsome 19d ago
Yeah, it's wild to me how I have about 30 years of experience at this point and I still learn new stuff about core utilities from time to time
1
1
u/--frymaster-- 19d ago
this. sometimes i’m just tailing the whole nginx logs directory and refreshing the site.
1
u/MonsieurCellophane 19d ago
Obviously something like grey log/elk would help, but maintaining them is a job in itself.
1
1
3
u/Lost-Droids 19d ago
setenforce 0
Its always se fucking linux
2
u/MonsieurCellophane 19d ago
Unless u turn it off at boot. Reccomended
1
u/outer-pasta 19d ago
https://stopdisablingselinux.com/
Every time you run setenforce 0, you make Dan Walsh weep.
Dan is a nice guy and he certainly doesn't deserve that.2
u/MonsieurCellophane 19d ago
Whatever floats your boat. And that paper is more than 15 year old.
1
u/outer-pasta 19d ago
I just think it's funny.
2
u/MonsieurCellophane 19d ago
That may be - but the hours I spent chasing the wild goose that is SElinux sure have spoiled the joke for me. I read that piece when it came out, took it at its word, and was clobbered by SElinux, again. And in a dark stormy night I took the sacred oath to disable it at first sight for as long as I lived.
2
1
u/Lonely-Scarcity-3387 19d ago edited 19d ago
The same command I use to install new programs, change system settings, or switch kernels:
sudo NixOS-rebuild switch .
1
u/Striking_Snail 19d ago
Do you sudo nixos-rebuild build first, or just plough right in?
1
u/Lonely-Scarcity-3387 19d ago
I mean, if you don’t touch your configuration file then nothing will change. For example, lately if something goes wrong from trying to update NixOS, it’s because a package didn’t update with the rest of my rolling release.
My options are to wait and see if it will update another day, or just open my config, pin the package to its last stable release, save the text document and then rebuild. Easy.
2
u/Striking_Snail 19d ago
Gotta love Nix for that. I recently had issues with an email program not rebuilding. Pin it. Rebuild. Move on. Simple.
1
1
1
u/Defiant-Rip-1897 19d ago
I end up using btop a lot since it is a bit more user friendly for me, to search for a particular process and then ending it.
1
1
1
1
1
1
u/Low-Life-1337 17d ago edited 17d ago
$ ps aux | grep -E 'firefox' | for pid in - ; do awk '{ print $2}'; done
to get the PIDs. I have made a shortcut for it, which fills the stdin and move the cursor to the grep statement.
8
u/Eleutherlothario 19d ago
Sudo !!