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?

Stephen Kitt
  • 434,908

1 Answers1

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.

Stephen Kitt
  • 434,908