Everything is consider a file in Linux, so your hard disk is kept track of as a file that sits there.
If you’re using an SATA hard drive as example, your hard drive will be known as /dev/sda. there is /dev/cdrom ,/dev/cdwriter , /dev/hda “IDE hard drive”.
Not only physical devices also all data are stored as files. in short
“IN LINUX, EVERYTHING IS A FILE“
this one of most important concept in Linux/Unix world.
One of primary Linux kernel responsibility schedule when and how processes interact with devices. The /proc/ directory contains a hierarchy of special files which represent the current state of the kernel allowing applications and users to peer into the kernel’s view of the system.
/proc/ directory considering secret door to The Kernel World. Within the /proc/ directory, one can find a wealth of information detailing the system hardware and any processes currently running. In addition, some of the files within the /proc/ directory tree can be manipulated by users and applications to communicate configuration changes to the kernel.
Most users are familiar with the two primary types of files: text and binary. But the /proc/ directory contains another type of file called a virtual file. It is for this reason that /proc/ is often referred to as a virtual file system.
Some of virtual file can be used to adjust settings in the kernel, This is especially true for files in the /proc/sys/ subdirectory.
Changing and reading virtual files is trivial easy, use the echo command and a greater than symbol (>) to redirect the new value to the file. For example, to make kernel totally ignore all ICMP Echo requests
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
And for reading use cat command
cat /proc/sys/net/ipv4/icmp_echo_ignore_all
Some of files that be can used to collect wealthy informations:
| /proc/buddyinfo /proc/cmdline /proc/cpuinfo /proc/crypto /proc/devices /proc/diskstats /proc/dma /proc/filesystems /proc/interrupts /proc/iomem |
/proc/ioports /proc/kcore /proc/kmsg /proc/loadavg /proc/locks /proc/mdstat /proc/meminfo /proc/modules /proc/mounts /proc/partitions |
/proc/slabinfo /proc/stat /proc/swaps /proc/uptime /proc/version /proc/vmstat |
to be continue