Its zero-length files are neither binary nor text, yet you can examine and display themUnder Linux, everything is managed as a file; even devices are accessed as files (in the /dev directory). Although you might think that “normal” files are either text or binary (or possibly device or pipe files), the /proc directory contains a stranger type: virtual files. These files are listed, but don’t actually exist on disk; Although almost all the files are read-only, a few writable ones (notably in /proc/sys) allow you to change kernel parameters. (Of course, you must be careful if you do this.)
The numbered directories correspond to each running process;a special self symlink points to the current process. Some virtual files provide hardware information, such as /proc/cpuinfo, /proc/meminfo, /proc/interrupts.
Others give file-related info, such as /proc/filesystems /proc/partitions.
The files under /proc/sys are related to kernel configuration parameters/proc/cmdline: Shows the parameters that were passed to the kernel at boot time.
/proc/dma: Shows the Direct Memory Access channels in use.
the numerical named directories represent all running processes.
When a process ends, its /proc directory disappears automatically
cmdline: Contains the command that started the process, with all its parameters.
cwd: A symlink to the current working directory (CWD)for the process; exe links to the process executable, and root links to its root directory.
environ: Shows all environment variables for the process.
fd:Contains all file descriptors for a process, showing which files or devices it is using.
maps, statm, and mem: Deal with the memory in use by the process.
stat and status: Provide information about the status of the process, but the latter is far clearer than the former.
if you want to program a better-looking top, all the needed information is right at your fingertips.