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?
/var/empty
is not empty, but contains a folder calledsshd
, so you probably don't want to use that./dev/null
isn't so much for reading as for writing. Data written to/dev/null
just disappears. So, a directory equivalent would be a place wheremv yourfile /dev/empty
would result in deleting your file.mv yourfile /dev/empty/
. If you domv yourfile /dev/empty
, you're trying to replace the special directory./dev/null
anddd
becausedd
will get an EOF before it's even written a single byte. I think you're thinking of/dev/zero
, which is often used to fill something with or generate a specific number of zeros./dev/null
with/dev/zero
.