Tips

Let’s Root Around In The /proc Directory

Today, we’re going to root around in the /proc directory. Why? So we can learn about our Linux system. See, there’s quite a bit of information hidden in there and I’m going to show you how to get it out of there. You’ll have to root around for it, as I’m not going to document every possible combination, but you’ll have the tools to do so.

We will be using the terminal for this, but we’ll only be using a couple of tools. The first tool we’ll use is the ‘ls’ command. We’ve used it before to sort files by time and sort files by size and even to show hidden files and folders. So, as you can guess, it’s a pretty handy command.

The other application we’ll be using is ‘cat’. We’ve used that less often, but we’ve used it before, but here’s a brief overview of the ‘cat’ command. You might want to read that. But, basically, we use the cat command to read files in the terminal. 

The ‘cat’ command is also a pretty handy command. You can try it out yourself. If we assume you’re using bash and have history enabled (the vast majority of Linux users) you can do something like:

cat ~/.bash_history

That command should spit out the history of commands you’ve typed into the terminal. Perhaps some of ’em will have been things you learned right here on Linux-Tips! Well, maybe… I mean, people tell me they learn stuff here, though I’m never quite sure how! 😉 Anyhow…

So, this will be a fairly informal article. It should also be quick and easy. You’re welcome!

Rooting Around In The /proc Directory:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Like I said, this is a fairly informal article. Quick and easy, right? Well, I’m going to show you everything you need to know in one command. Ready?

ls /proc

You’ll see a whole lot of files. What you want to do is use ‘cat’ on those files. Like, if you want to read/check your CPU information, you’d use:

cat /proc/cpuinfo

Do you want to see the information the system has for your memory?

cat /proc/meminfo

Not all the files have useful data, but some of them do. That’s why you’ve gotta root around in there. You’ve gotta learn which files contain which information – but I’ve given you a head start with two of them. You’re on a path of discovery, ’cause I’m surely not going to go through all of ’em to tell you what they do. I give you the tools, you do the work. Or something like that…

Closure:

See? Nice and easy, and very much an informal article. You can now root around in the /proc directory to get some system information. You may need elevated permissions to read some files, and some of them contain what’s pure gibberish to me. They might make more sense to you!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

17 hours ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

3 days ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

5 days ago

Extract Text From Multiple File Types

Today we will have a fairly simple exercise as we're going to just use a…

7 days ago

Meta: I’ve Been At This For Three Years!

I have not done a meta article lately. I don't find them interesting to write…

1 week ago

How To: Disable CPU Cores

This is not something everyone is interested in doing but you might as well learn…

2 weeks ago