xdg-user-dir

Find an XDG user directory path

TLDR

Show home directory (default with no argument)
$ xdg-user-dir
Show the Downloads directory path
$ xdg-user-dir DOWNLOAD
Show the Documents directory path
$ xdg-user-dir DOCUMENTS
Show the Desktop directory path
$ xdg-user-dir DESKTOP

SYNOPSIS

xdg-user-dir [DIRECTORY]

DESCRIPTION

xdg-user-dir looks up the current path for an XDG user directory as defined in the user-dirs.dirs configuration file. These are the standard directories for common content types like documents, music, and downloads.The paths are configured in ~/.config/user-dirs.dirs and can be customized per user. The XDG_CONFIG_HOME environment variable determines where the configuration file is located.

PARAMETERS

DESKTOP

Desktop directory
DOWNLOAD
Downloads directory
DOCUMENTS
Documents directory
MUSIC
Music directory
PICTURES
Pictures directory
VIDEOS
Videos directory
TEMPLATES
Templates directory
PUBLICSHARE
Public share directory
--help
Display help and exit
--version
Show version information and exit

INSTALL

sudo apt install xdg-user-dirs
sudo dnf install xdg-user-dirs
sudo pacman -S xdg-user-dirs
sudo apk add xdg-user-dirs
sudo zypper install xdg-user-dirs
nix profile install nixpkgs#xdg-user-dirs

CAVEATS

Returns home directory if the requested directory is not configured or if an unknown directory name is given. Directory paths may not exist on the filesystem.

SEE ALSO

xdg-user-dirs-update(1), xdg-open(1), xdg-mime(1)