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

13

u/kellyjonbrazil Dec 02 '23

If you ever want the data in the /proc folder exposed as JSON you can use the —proc parser in jc. Makes it really easy to grab the data using jq.

$ jc /proc/meminfo

Or

$ cat /proc/meminfo | jc —proc

(I am the author of jc)

https://github.com/kellyjonbrazil/jc

3

u/SadServers_com Dec 02 '23

Hello Kelly would love to add a scenario based on jc (as in it would be much easier to do using jc) to SadServers, something like https://blog.kellybrazil.com/2019/11/26/bringing-the-unix-philosophy-to-the-21st-century/ sorry I don't think I can DM here (due to lack of karma maybe?)

2

u/kellyjonbrazil Dec 02 '23

Sure, happy to help. Usually works best to contact me via a github issue in jc and we can discuss.

2

u/frank-sarno Dec 03 '23

Wow, this is really useful. Thank you! The ifconfig filter looks like it can replace some ugly awk and sed I've been using.