写于:2015-01-05	最近一次更新:2015-08-06

Trouble:

当初在新装Slackware时选择了语言为中文简体, 于是用户家目录下的常用文件夹都是以中文命名的, 如“下载”“桌面”“文档”, 不是英文形式的“Downloads”“Desktop”“Documents”, 而我们经常当要 cd 进“下载”“桌面”“文档”这些目录时 就没有 cd 进“Downloads”“Desktop”“Documents”方便

Oneway:

于是就有人新建“Downloads”“Desktop”“Documents”这些目录, 然后再链接到相应的中文目录 其实,这么做更好 如果 ~/.config/user-dirs.dirs 文件已经存在时请直接修改这个文件如下 # This file is written by xdg-user-dirs-update # If you want to change or add directories, just edit the line you're # interested in. All local changes will be retained on the next run # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported. # XDG_DESKTOP_DIR="$HOME/Desktop" XDG_DOWNLOAD_DIR="$HOME/Downloads" XDG_TEMPLATES_DIR="$HOME/Templates" XDG_PUBLICSHARE_DIR="$HOME/Public" XDG_DOCUMENTS_DIR="$HOME/Documents" XDG_MUSIC_DIR="$HOME/Music" XDG_PICTURES_DIR="$HOME/Pictures" XDG_VIDEOS_DIR="$HOME/Videos" 然后,运行 xdg-user-dirs-update 即可 如果 ~/.config/user-dirs.dirs 文件不存在,请先提权到root用户身份, 修改/etc/xdg/user-dirs.defaults里的内容如下 # Default settings for user directories # # The values are relative pathnames from the home directory and # will be translated on a per-path-element basis into the users locale DESKTOP=Desktop DOWNLOAD=Downloads TEMPLATES=Templates PUBLICSHARE=Public DOCUMENTS=Documents MUSIC=Music PICTURES=Pictures VIDEOS=Videos # Another alternative is: #MUSIC=Documents/Music #PICTURES=Documents/Pictures #VIDEOS=Documents/Videos 然后,回到当前用户身份,运行 xdg-user-dirs-update 即可