This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the unix category.
Last Updated: 2024-11-21
Unix recommends specific directories for placing certain types of files:
$XDG_CACHE_HOME
for storing persistent cache files (works with
unprivileged processes)Aside: XDG is "X Desktop Group" - a set of standards. It seems to be used in non-desktop linux installs too.
$XDG_DOWNLOAD_DIR
for storing persistent downloaded files (works with
unprivileged processes)$TMPDIR
instead of /tmp
(etc.) since this gives more flexibility to
systems that choose to modify where TMP is.