Is there a directory equivalent of /dev/null in Linux?

roelvanmeer asked:

When configuring an application, you can often use /dev/null as config file if you want the application to read an empty file. But, if the application reads a list of files from a directory, you cannot use this trick. You would need to give it an empty directory to read.

I was wondering: does Linux have a default empty directory that can be used for such purposes? I know OpenSSH used /var/empty for a while, and I can of course create an empty dir myself, but maybe the FHS has specified a standard directory for this?

My answer:


The FHS provides no “standard” empty directory. You can create one yourself, as a subdirectory of /run or /tmp. For this use case, the latter is probably the better fit, though in practice it matters little.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.