How to get the correct Linux user's documents, music videos and other directories?

Liu Kunpeng 2021-11-25 17:38:12

It's strange for someone to see the title , Isn't this located in the user directory ? For example, there is a music directory under the directory , Are you sure it's the user's directory ? Not created later ? What to do with that ?

In the user directory , see file .config/user-dirs.dirs 

# .config/user-dirs.dirs 
XDG_DESKTOP_DIR="$HOME/ desktop "
XDG_DOWNLOAD_DIR="$HOME/ download "
XDG_TEMPLATES_DIR="$HOME/ Templates "
XDG_PUBLICSHARE_DIR="$HOME/ Public "
XDG_DOCUMENTS_DIR="$HOME/ file "
XDG_MUSIC_DIR="$HOME/ music "
XDG_PICTURES_DIR="$HOME/ picture "
XDG_VIDEOS_DIR="$HOME/ video "

How to get these variables ? There are two ways :

  • Read the file , Do it yourself .
  • source .config/user-dirs.dirs, Then you have these variables .
Please bring the original link to reprint ,thank
Similar articles

2021-11-25

2021-11-25

2021-11-25

2021-11-25

2021-11-25