O'Reilly logo

Linux Shell Scripting Cookbook by Sarath Lakshman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using /proc – gathering information

/proc is an in-memory pseudo filesystem available on GNU/Linux operating systems. It was introduced to provide an interface to read several system parameters from a user space. It is very interesting and we can gather lots of information from it. Let's see few of the features available with the proc filesystem.

How to do it...

If you look at /proc, you can see several files and directories. Some of them are already explained in another recipe in this chapter. You can simply cat files in /proc and the subdirectories to get information. All of them are well-formatted text.

There will be a directory in /proc for every process that is running on the system. The directory name for a process in /proc is same as that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required