Linux – Location of application files

directory-structurelinux

Does Linux/Unix have a unified location for Application files, like "~/Library/Application Support" on Mac OS X? I'm making a Python script that will need to store permanent but changing data, and I want it to work universally.

Best Answer

Have a look at the XDG Base Directory Specification. In your case it should probably be $XDG_DATA_HOME:

$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

Please note: if you are writing a daemon you should use something like /var/lib/ or /var/cache/ to save your data.

Related Question