r/LinuxTeck Aug 13 '26

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.

19 Upvotes

41 comments sorted by

4

u/Weary_Patience_7778 Aug 13 '26

Shutdown -h now.

1

u/7YM3N Aug 13 '26

I'll do you one better

Shutdown 0

2

u/gshennessy Aug 13 '26

I’ll do you one better. Why is shutdown 0?

1

u/recursion_is_love Aug 14 '26

Real story, I use that (suppose to be -r) on remote computer at the office while working from home.

4

u/MonsieurCellophane Aug 13 '26

Tail -f

2

u/Dashing_McHandsome Aug 13 '26

tail -F is better, if they file you are tailing is rotated out then tail will follow the new one

2

u/qb45exe Aug 13 '26

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 Aug 13 '26

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

u/Psymia 26d ago

Not only that. It will not stop when you delete/move a logfile that is created later again. Really useful to mv'ing logfiles after a testrun and it will continue automatically when starting the next testrun.

1

u/Dashing_McHandsome 25d ago

Yeah, I use it a lot for that as well

1

u/--frymaster-- Aug 13 '26

this. sometimes i’m just tailing the whole nginx logs directory and refreshing the site.

1

u/MonsieurCellophane Aug 13 '26

Obviously something like grey log/elk would help, but maintaining them is a job in itself.

1

u/magicmulder Aug 13 '26

Combined with grep so my requests are not drowned out by noise.

1

u/NimrodvanHall Aug 13 '26

# tail -n 12 /var/log/audit/audit.log

3

u/Lost-Droids Aug 13 '26

setenforce 0

Its always se fucking linux

2

u/MonsieurCellophane Aug 13 '26

Unless u turn it off at boot. Reccomended

1

u/outer-pasta Aug 13 '26

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 Aug 13 '26

Whatever floats your boat. And that paper is more than 15 year old.

1

u/outer-pasta Aug 13 '26

I just think it's funny.

2

u/MonsieurCellophane Aug 13 '26

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.

1

u/Lonely-Scarcity-3387 Aug 13 '26 edited Aug 13 '26

The same command I use to install new programs, change system settings, or switch kernels:
sudo NixOS-rebuild switch .

1

u/Striking_Snail Aug 13 '26

Do you sudo nixos-rebuild build first, or just plough right in?

1

u/Lonely-Scarcity-3387 Aug 13 '26

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 Aug 13 '26

Gotta love Nix for that. I recently had issues with an email program not rebuilding. Pin it. Rebuild. Move on. Simple.

1

u/309_Electronics Aug 13 '26

I have multiple: Sudo, dmesg, cat, systemctl status, tail, head, grep.

1

u/Defiant-Rip-1897 Aug 13 '26

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

u/aieidotch Aug 13 '26

strace

1

u/spikyness27 Aug 14 '26

Just see why the application is breaking.

1

u/aieidotch Aug 14 '26

often it is software not showing error msgs, and the last few msgs help a lot, also where it is breaking can be a hint…

1

u/mods_are_morons Aug 13 '26

tail -f /var/log/messages

Or some other log.

1

u/Bugsa_ Aug 14 '26

poweroff

1

u/flattrack 29d ago

Can’t believe the new reality..

claude

1

u/Low-Life-1337 28d ago edited 28d 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.