[TUHS] A question about ls(1)

Theodore Ts'o tytso at mit.edu
Tue Apr 30 21:52:31 AEST 2019

On Mon, Apr 29, 2019 at 03:32:19PM -0700, Bakul Shah wrote:
> > My workstation Debian system has a staggering 3467 files in that
> > directory, spread around 444 directories (75 directories directly
> > under ~/.config). Plus another 142 dot-directories and 66 dotfiles in
> > ~/. Now, ~/.config typically uses multiple files per application, and
> > at a glance there's some stuff there that could definitely go, but I
> > still shudder to think of having all of those directly under ~/, so
> > it's clearly doing _some_ good in that regard.
> I suspect most of these files contain some state and cached
> application data or content as opposed to configuration.

Applications which follow the XDG specification (which is what
specified ~/.config are supposed to use ~/.cache for cache files (the
per-user analog of /var/cache) and ~/.local/share for data files (the
per-user analog of /usr/share).  These locations can be overridden by
the environment variables XDG_CACHE_HOME, XDG_DATA_HOME, and
XDG_CONFIG_HOME to override ~/.config.

While I would never under-estimate the ability for application writers
to Get Things Wrong[1], at least in theory there should *not* be state
or cache files stored in ~/.config.

[1] For example, GUI text editors updating precious files in place
using O_TRUNC, as opposed to writing to foo.new, reading the extended
attributes and Posix ACL's from file foo and writing them to foo.new,
calling fsync, and then renaming foo.new to foo --- because The Right
Way is too much trouble for an application author.  Sigh....


						- Ted

More information about the TUHS mailing list