Linux

Where Are Linux Special Folders Configured?

The user-dirs files mapping Documents, Downloads and friends on Linux, and how to disable one.

Last updated

Linux maps Desktop, Documents, Downloads and friends in ~/.config/user-dirs.dirs: shell style lines like XDG_DOWNLOAD_DIR="$HOME/Downloads" that every compliant app reads. System defaults seed from /etc/xdg/user-dirs.defaults, translated per locale at first login.

To disable a special folder, point its line at $HOME; deleting the line just gets it recreated or reset on next login unless updates are disabled. Query the live value with xdg-user-dir DOWNLOAD and set one with xdg-user-dirs-update --set. The actual folders are created localized by the same updater at login.

Where Linux stores this, by platform

Linux
~/.config/user-dirs.dirs

Per user mapping ($XDG_CONFIG_HOME respected). Defaults in /etc/xdg/user-dirs.defaults; behavior flags in /etc/xdg/user-dirs.conf plus ~/.config/user-dirs.conf. Actual folders (Desktop, Documents, Downloads, Music, Pictures, Videos, Templates, Public) created at first login.

Frequently asked questions

How do I remove the Templates or Public folder permanently?

Point its XDG line at $HOME instead of deleting it. Deleted lines and missing folders get recreated or reset to $HOME on next login unless you disable updates in user-dirs.conf.

Why is my Downloads folder named differently after changing language?

The updater translates folder names per locale using the user-dirs.locale stamp. Old contents stay in the previous name; move them by hand or repoint with xdg-user-dirs-update --set.

Notice an outdated path? Let us know.