Is there a general term for the items in a directory?

The POSIX readdir documentation uses the word entry:

The readdir() function shall return a pointer to a structure representing the directory entry at the current position in the directory stream specified by the argument dirp, and position the directory stream at the next entry. It shall return a null pointer upon reaching the end of the directory stream. The structure dirent defined in the <dirent.h> header describes a directory entry.

File. At least in POSIX-compliant systems.

3.164 File

An object that can be written to, or read from, or both. A file has certain attributes, including access permissions and type. File types include regular file, character special file, block special file, FIFO special file, symbolic link, socket, and directory. Other types of files may be supported by the implementation.


People saying "files" when they mean only "regular files" are not really POSIX-compliant. :)

You can learn what POSIX is from answers to this question. Various operating systems are POSIX-compliant (fully or mostly) or not. Without going into details, this answer applies to Unix and Unix-like systems (including macOS, Linux, BSD), but not to Windows family in general.

Good question.

I use "contents" as a term that encompasses both files and subfolders.

For example: "We need to copy all of the contents of that directory."