Everything Is a File (Prove It)
EasyLinux Fundamentals10-15 minLinux's big idea: almost everything is exposed as a file you can read with ordinary tools. Not just documents — running kernel state, hardware devices, even processes all appear in the filesystem. Prove it three ways, writing each answer under /root/answers/ (already created):
1. Kernel state is a file — /proc is a live, virtual view of the kernel. Copy the FIRST line of /proc/meminfo (the MemTotal line) into /root/answers/mem.txt.
2. A device is a file — /dev/null is a real device, not a document. Use stat to get its human-readable type and write ONLY that type string into /root/answers/devtype.txt (hint: stat -c %F).
3. ls -l tells you the KIND — the very first character of an ls -l line is the file's type (- regular, d directory, l symlink, c char device, b block device). Write the single type character for /dev/null into /root/answers/devchar.txt.
Nothing here is a normal text file, yet cat/stat/ls read them all the same. That's the whole point.
- Read live kernel state from /proc and capture the MemTotal line
- Use stat to identify /dev/null as a device (not a regular file)
- Read the ls -l type character for a device file
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
