长话短说,我不小心跑sudo rm -rf ~了,结果删除了我的大部分主目录。在惊慌失措的状态下,经过一些研究,我尝试使用 extundelete 恢复我所能恢复的内容,它已经恢复了一些文件。
除此之外,我已经“丢失”了主目录中的常用文件,我只剩下下载文件夹,因为我没有在其他目录中存储任何太重要的东西,如果可能的话,我想恢复它们。
我查看了文件 ~/.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/"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/" …Run Code Online (Sandbox Code Playgroud)