01 / 06
Files that are not on the disk
Chapter 9 ends in a slightly strange place.
~ $ cat /proc/uptime2.36 1.43Out came how many seconds since it started. But this /proc/uptime is not on the disk.
look at /proc with df -h and the size is 0ls -l /proc/uptime says 0 as welland still cat gives you contentsWhat is happening is that the kernel makes it at the moment you try to read, and hands it over.
cat /proc/uptime | "I want to read"the kernel works out the numbers as of now |it hands over the characters "2.36 1.43"So read it twice and you get different numbers. A counter dressed up as a file.
In Linux this arrangement is called procfs (the process file system). Remember the proc line in df last lesson? That was this.