1

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?

2

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

They are /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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.