# phpman > man > xdg-user-dirs-update(1)

> **TLDR:** Update XDG user directories.
>
- Change XDG's DESKTOP directory to the specified directory:
  `xdg-user-dirs-update --set DESKTOP "/{{path/to/directory}}"`
- Create any missing directories:
  `xdg-user-dirs-update --force`
- Write the result to the specified dry-run-file instead of the `user-dirs.dirs` file:
  `xdg-user-dirs-update --dummy-output "{{path/to/dry_run_file}}" --set {{xdg_user_directory}} "/{{path/to/directory}}"`

*Source: tldr-pages*

---

[XDG-USER-DIRS-UPD(1)](https://www.chedong.com/phpMan.php/man/XDG-USER-DIRS-UPD/1/markdown)                        User Commands                       [XDG-USER-DIRS-UPD(1)](https://www.chedong.com/phpMan.php/man/XDG-USER-DIRS-UPD/1/markdown)



## NAME
       xdg-user-dirs-update - Update XDG user dir configuration

## SYNOPSIS
       **xdg-user-dirs-update** [OPTION...] [--set _NAME_ _PATH_...]

## DESCRIPTION
       **xdg-user-dirs-update** updates the current state of the users user-dirs.dir. If none existed
       before then one is created based on the system default values, or falling back to the old
       non-translated filenames if such directories exists. The list of old directories used are:
       ~/Desktop, ~/Templates and ~/Public.

       If an old configuration exists it is updated with any new default directories. Additionally,
       any configured directories that point to non-existing locations are reset by pointing then to
       the users home directory. This typically happens when the users removed the directory, so
       they likely don't want to use it anymore.

       On the first run a user-dirs.locale file is created containing the locale that was used for
       the translation. This is used later by GUI tools like **xdg-user-dirs-gtk-update** to detect if
       the locale was changed, letting you to migrate from the old names.

       **xdg-user-dirs-update** is normally run automatically at the start of a user session to update
       the XDG user dirs according to the users locale.

## OPTIONS
       The following options are understood:

### --help
           Print help output and exit.

### --force
           Update existing user-dirs.dir, but force a full reset. This means: Don't reset
           nonexisting directories to HOME, rather recreate the directory. Never use backwards
           compatible non-translated names. Always recreate user-dirs.locale.

       **--dummy-output** _PATH_
           Write the configuration to _PATH_ instead of the default configuration file. Also, no
           directories are created.

       **--set** _NAME_ _PATH_
           Sets the XDG user dir with the given name.

           _NAME_ should be one of the following:
               DESKTOP
               DOWNLOAD
               TEMPLATES
               PUBLICSHARE
               DOCUMENTS
               MUSIC
               PICTURES
               VIDEOS

           _PATH_ must be an absolute path, e.g.  $HOME/Some/Directory.

## FILES
       The XDG user dirs configuration is stored in the user-dirs.dir file in the location pointed
       to by the **XDG**___**CONFIG**___**HOME** environment variable.

## ENVIRONMENT
       The **XDG**___**CONFIG**___**HOME** environment variable determines where the user-dirs.dirs file is located.

## SEE ALSO
       [**xdg-user-dir**(1)](https://www.chedong.com/phpMan.php/man/xdg-user-dir/1/markdown), [**user-dirs.dirs**(5)](https://www.chedong.com/phpMan.php/man/user-dirs.dirs/5/markdown), [**user-dirs.defaults**(5)](https://www.chedong.com/phpMan.php/man/user-dirs.defaults/5/markdown), [**user-dirs.conf**(5)](https://www.chedong.com/phpMan.php/man/user-dirs.conf/5/markdown).



XDG                                                                             [XDG-USER-DIRS-UPD(1)](https://www.chedong.com/phpMan.php/man/XDG-USER-DIRS-UPD/1/markdown)
