1.误删除Ubuntu家目录下系统自带文件夹如Desktop、Downloads等
在开发过程中,不小心在终端中把当前用户的Desktop、Downloads、Music等文件夹删除。 解决措施: 通过修改 ~/.config/user-dirs.dirs 中的XDG_DESKTOP_DIR来重新指定系统文件夹:
1# This file is written by xdg-user-dirs-update 2# If you want to change or add directories, just edit the line you're 3# interested in. All local changes will be retained on the next run 4# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped 5# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an 6# absolute path. No other format is supported. 7# 8XDG_DESKTOP_DIR="$HOME/Desktop" 9XDG_DOWNLOAD_DIR="$HOME/Downloads" 10XDG_TEMPLATES_DIR="$HOME/Template" 11XDG_PUBLICSHARE_DIR="$HOME/Public" 12XDG_DOCUMENTS_DIR="$HOME/Documents" 13XDG_MUSIC_DIR="$HOME/Music" 14XDG_PICTURES_DIR="$HOME/Pictures" 15XDG_VIDEOS_DIR="$HOME/Videos"
如果在家目录下不存在这些文件夹,可以在终端中执行mkdir xxx创建相应文件夹,再重启即可匹配到相应系统文件夹。
本文原文首发来自博客专栏Linux开发,由本人转发至https://www.helloworld.net/p/GygSV7tALU4J,其他平台均属侵权,可点击https://blog.csdn.net/CUFEECR/article/details/104148395查看原文,也可点击https://blog.csdn.net/CUFEECR浏览更多优质原创内容。
