LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

xdg-user-dirs-update

Update XDG user directory configuration

TLDR

Change XDG's DESKTOP directory to a specified directory
$ xdg-user-dirs-update --set DESKTOP "/[path/to/directory]"
copy
Set the DOWNLOAD directory to a custom path
$ xdg-user-dirs-update --set DOWNLOAD "/[path/to/downloads]"
copy
Write the result to a dry-run file instead of user-dirs.dirs
$ xdg-user-dirs-update --dummy-output "[path/to/dry_run_file]" --set [xdg_user_directory] "/[path/to/directory]"
copy
Force a complete reset of the user directory configuration
$ xdg-user-dirs-update --force
copy

SYNOPSIS

xdg-user-dirs-update [OPTION...] [--set NAME PATH...]

DESCRIPTION

xdg-user-dirs-update updates the current state of the user's user-dirs.dirs file. If none existed before, one is created based on system default values. XDG user directories are special folders like Desktop, Documents, Downloads, Music, Pictures, and Videos.The configuration is stored in ~/.config/user-dirs.dirs and defines where applications should look for user content directories. A user-dirs.locale file is also created on first run to track which locale was used for directory name translations.This command is normally run automatically at the start of a user session. Directories pointing to non-existent locations are reset to the user's home directory.

PARAMETERS

--set NAME PATH

Set a specific user directory. NAME must be one of DESKTOP, DOWNLOAD, TEMPLATES, PUBLICSHARE, DOCUMENTS, MUSIC, PICTURES, or VIDEOS. PATH must be absolute.
--dummy-output PATH
Write the configuration to PATH instead of the default configuration file. No directories are created when using this option.
--force
Force a complete reset of existing configuration. Recreates directories instead of resetting to HOME and always recreates the locale file.
--help
Print help output and exit.

CAVEATS

Changing directories doesn't move existing content. Applications may need to be restarted to recognize changes. The specified paths must be absolute. Part of the xdg-user-dirs package.

SEE ALSO

Copied to clipboard
Kai