Pick a Free OS

User login

Navigation

Exploring /proc

-r--r--r-- 1 root root 0 Nov 30 12:20 cmdline

lrwx------ 1 root root 0 Nov 30 12:20 cwd -> /var/named

-r-------- 1 root root 0 Nov 30 12:20 environ

lrwx------ 1 root root 0 Nov 30 12:20 exe -> /usr/sbin/named

dr-x------ 2 root root 0 Nov 30 12:20 fd

pr--r--r-- 1 root root 0 Nov 30 12:20 maps

-rw------- 1 root root 0 Nov 30 12:20 mem

lrwx------ 1 root root 0 Nov 30 12:20 root -> /

-r--r--r-- 1 root root 0 Nov 30 12:20 stat

-r--r--r-- 1 root root 0 Nov 30 12:20 statm

-r--r--r-- 1 root root 0 Nov 30 12:20 status

Before executing this command you need to log in as root because the

various processes running on the system may be owned by various other

users. As usual you have access only to the processes that you have

started. After having logged in as root just execute the above command for

any of the directories and compare the output to what is listed above.

Did you notice any similarity in the output you got and the one listed

above? Yes, the contents of all the directories are the same irrespective

of the directory you choose to view as these directories contain the

various parameters and the status of the process whose PID is the name of

the current directory that you are in. The values of the various

parameters and status information would of course vary from process to

process.

Look at the first line of the output as viewed above.

-r--r--r-- 1 root root 0 Nov30 12:20 cmdline

"cmdline", this file contains the whole command line used to invoke the

process. The contents of this file are the command line arguments with all

the parameters that one has passed to start the particular process. All

the information contained in the file is without any formatting and any

space between the command line arguments and various arguments.

lrwx------ 1 root root 0 Nov 30 12:20 cwd -> /var/named

"cwd", as is visible from above this is a symbolic link to the current

working directory of that particular process.

-r-------- 1 root root 0 Nov 30 12:20 environ

"environ" contains all the environment variables defined for this

particular process in the form VARIABLE=value. As with cmdline, all the

information contained in the file is without any formatting or space