What is the noun for either a file or folder?

We have files, we have directories; what is the noun that we could use to generically describe either of these? For instance, an apple or a pear can generically be described as fruit. Is there such a word?


Solution 1:

If you want to be technical, they're File System Objects (or "File System Entries", if you want to be pendatic and technical.)

Of course, both are mouthfuls and not any more efficient than "file or folder." Although such terms do encompass symlinks as well, which are neither files nor folders but may appear as either.

Solution 2:

“All directories are files, but not all files are directories”

A standard, run-of-the-mill filesystem will support at least these distinct types of files:

  • regular file
  • directory file
  • character special file
  • block special file
  • named pipe (fifo) file
  • socket file
  • symbolic link file

But many other types of files exist on specialty filesystems. Here are just a few of the rare types you may chance upon:

  • network special file
  • context-dependent file
  • resource-fork file
  • whiteout file
  • portal file
  • door file
  • shared-memory file
  • semaphore file
  • message-queue file
  • shadow file (for ACLs)
  • attribute directory
  • extended-attribute file

More exotic filesystem types have even more exotic sorts of files that can be found there.


Summary

In short, the generic term is actually file, with both regular files and directory files being distinct subtypes of the generic file, and many other sorts also existing.