LinuxCommandLibrary

xdg-user-dir

Query XDG user directory paths

TLDR

Show home directory

$ xdg-user-dir
copy
Show specific directory
$ xdg-user-dir [DESKTOP|DOWNLOAD|TEMPLATES|PUBLICSHARE|DOCUMENTS|MUSIC|PICTURES|VIDEOS]
copy

SYNOPSIS

xdg-user-dir [DIRECTORY]

DESCRIPTION

xdg-user-dir retrieves the path of XDG user directories 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.

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

CAVEATS

Returns home directory if the requested directory is not configured. Directory paths may not exist on the filesystem.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community