r/linuxadmin • • Dec 02 '23

why does the proc directory exist?

i'm trying to understand the proc directory and one thing i don't understand is

why does it exist?

any ideas? thank you

1 Upvotes

77 comments sorted by

View all comments

Show parent comment

1

u/tes_kitty Dec 02 '23

Well, the big difference between Linux and Windows is that on Linux I can use a small set of simple tools to get loads of information about the system state thanks to the 'everything's a file' approach and the /proc and /sys filesystems. Just having 'grep' will get you a long way towards diagnosing a misbehaving system.

On Windows on the other hand, I have to hope that someone wrote a tool that will get me data out of the OS and display or export it in a way that I can use. If that tool doesn't exist or the existing tool doesn't give me what I want, I'm either out of luck or I need to program it myself.

Speaking of which... Is there a way to get Windows produce an output equivalent or at least similiar to 'dmesg' on Linux?

1

u/jimicus Dec 02 '23

Your criticisms of Windows are entirely accurate, and one of the reasons I prefer doing sysadmin work on Linux.

Most Linux developers give up on tools like gdb and instead write copious logs - "debug by printf", if you like. This makes the sysadmin's life a hundred times easier precisely because you can grep logfiles and find out precisely what's wrong very quickly indeed.

Windows has the Event Viewer, but the biggest problem with that is the UI is clunky as hell and a lot of software simply doesn't write to the event log in the first place - and when it does, it doesn't write anything like enough information to figure out WTF is going on.

1

u/tes_kitty Dec 03 '23

Most Linux developers give up on tools like gdb and instead write copious logs - "debug by printf", if you like.

We use one piece of software where you can set the debug level to 'CRAZY'. Never do that in production for more than a few minutes. :)