So far, I have only seen virtual files with a size of 0, for example the virtual file
/proc/sys/kernel/hostname has a size of 0.
But do all virtual files have a size of 0, or are there some virtual files that the kernel shows the size of?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The vast majority have no size, but there are a few exceptions, which you can see with
find /proc -type f \! -empty -ls 2>/dev/null
/proc/kcore and various PCI files.
See /proc/config.gz is of 0 bytes and What happens when I run the command cat /proc/cpuinfo? for related information.