O'Reilly logo

Linux Utilities Cookbook by James Kent Lewis

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

Observing a process using the /proc filesystem

The /proc filesystem is where Linux stores the data related to the currently running processes. In most cases, a casual user would probably never (hopefully never) need to know this information. However, it can be really helpful during debugging, or if you just want to know about some of the internals of Linux.

How to do it...

The following steps explain how to see the information contained in /proc:

  1. Let’s try an experiment in /proc as root run:
    file uptime
    
  2. It shows uptime: empty, right? So if we cat it, there should be no output ideally, right? Try it:
    cat uptime
    
  3. Wow, so how did that happen? The files in /proc are special because the information is read out of them in real time. Let’s try some more ...

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