Search code examples
directorymime-types

MIME type for a directory


What's the MIME type for an OS directory?

When I attempt to detect a directory's MIME type using its content I get text/plain; charset=utf-8 on Ubuntu.


Solution

  • On Ubuntu, a directory mimetype is inode/directory

    If you run, on Ubuntu:

    $ mimetype /home/<your username>
    /home/<your username>: inode/directory
    

    There is a "text/directory" in the IANA standards (http://www.rfc-editor.org/rfc/rfc2425.txt and http://www.iana.org/assignments/media-types/text) but it was marked "deprecated".