Also known as zombie files. If you are unlucky they can take up all space on a drive, or even tmpfs (so your ram) and you can’t easily find them. At least until you end the right process or restart.
Had that happen once and had to write my own script to trace it to the log of an open terminal emulator tab that had billions of lines.
These days there can be a dozen virtual filesystems doing various stuff. If you ever want to get quite baffled, install a terminal emulator on an Android phone (not Termux) and run mount.
It still is! If you try and boot a kernel with nothing in /dev, you won’t get most of the kernel boot messages since /dev/console doesn’t exist. You need a basic set of device nodes in /dev before udev is started.
If you’re going to rsync a system to new hardware and exclude /dev /proc /sys, it’s better to setup a new mount of your / to a different directory and sync off that, so you get the underlying stuff without the cruft.
I know what a symlink is, but what is a magic symlink?
Also known as zombie files. If you are unlucky they can take up all space on a drive, or even tmpfs (so your ram) and you can’t easily find them. At least until you end the right process or restart.
Had that happen once and had to write my own script to trace it to the log of an open terminal emulator tab that had billions of lines.
A symlink that has been blessed by Richard Stallman.
“Now that’s a name I haven’t heard in a long time” -Saint IGNUcius
If you delete a file that’s still open by the app, the link in proc will still exist and you can copy the file back out of proc.
Does that not make them a hard link (pointing to a filesystem node) instead of a symlink (pointing to another filename)?
No, you can’t have a hard link cross filesystems and proc is its own fs type.
Ah - it has its own special magical file system type, that’s the secret sauce. Neat!
/dev and /sys are the other two special ones
These days there can be a dozen virtual filesystems doing various stuff. If you ever want to get quite baffled, install a terminal emulator on an Android phone (not Termux) and run
mount.Remember the old days before /dev was its own virtual filesystem?
It still is! If you try and boot a kernel with nothing in /dev, you won’t get most of the kernel boot messages since /dev/console doesn’t exist. You need a basic set of device nodes in /dev before udev is started.
If you’re going to rsync a system to new hardware and exclude /dev /proc /sys, it’s better to setup a new mount of your / to a different directory and sync off that, so you get the underlying stuff without the cruft.