0

One day I moved the Documents directory inside the Downloads directory. I could still access it as usual, but, eventually, I ended receiving this message (also see the screenshot):

Oops! Something went wrong.
Unable to find the requested file. Please check the spelling and try again.

error screenshot

$ cat ~/.config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/"

I ran

gedit ~/.config/user-dirs.dirs

Rerun of

$ cat ~/.config/user-dirs.dirs
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"

Update 21st October 2019
As mentioned I moved my Music and Video files to the Home directory. So I did the re-run of gedit ~/.config/user-dirs.dirs. Type in Documents, Music and Videos.

Everything appeared as usual. I tried restarting it and shutting down my laptop. The Music and Videos directory remains there and can be opened. Did it again:

gedit ~/.config/user-dirs.dirs

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"

Yet the Documents directory has not appeared. So the Document Directory is deleted. I will now try to use Photorec to use recover my Home Directory and files.

mv $HOME/Downloads/Documents $HOME/Documents
mv: cannot stat '/home/user/Downloads/Documents': No such file or directory

Older information:

I clicked properties on Documents everything on basic came up unknown and permissions: The permissions of "" could not be found.

Older information:
cat '/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
5
  • 1
    if you moved Documents to Downloads, you can just move it back?!
    – pLumo
    Oct 8, 2019 at 12:01
  • 1
    What do you get if you run cat ~/.config/user-dirs.dirs?
    – Kulfy
    Oct 8, 2019 at 13:47
  • When answering questions from folks here, please put your answer into the question by clicking edit; instead of using Add Comment, please use edit.
    – K7AAY
    Oct 8, 2019 at 18:53
  • Ok so ~/Documents directory exists? Please edit ~/.config/user-dirs.dirs file to make its content look like this
    – Kulfy
    Oct 9, 2019 at 11:58
  • This ain't working for me! Jan 21, 2021 at 19:24

3 Answers 3

0

Just move it back ..

I guess that you did mv Documents Downloads ?

So the reverse operation is mv Downloads/Documents Documents, or to make it work from any working directory mv $HOME/Downloads/Documents $HOME/Documents.

2
  • 1
    I copied in tried both commands-didn't work. Oct 9, 2019 at 12:36
  • How did it not work ... What error did you get ? Are the `Document back in your home directory, or is it still in $HOME/Download ?
    – Soren A
    Oct 9, 2019 at 12:37
0

My strategy to solve this problem is as follows:

  1. Restore the default folders for Documents, Downloads, Music, etc.
  2. Test the Documents folder by creating a new .txt file in it and try to open that .txt file in Gedit.
  3. Locate any missing documents and move them back into the Documents folder where they belong.
$ ~/.config/user-dirs.dirs
bash: /home/elizabeth/.config/user-dirs.dirs: Permission denied

The Permission denied message is the normal message that results from running ~/.config/user-dirs.dirs, so there's no problem there. The problem is that some of the directories in ~/.config/user-dirs.dirs are wrong, and three of these directories are duplicates of each other.

To restore these directories back to their default locations open the terminal and type:

gedit ~/.config/user-dirs.dirs

Change the following lines in gedit text editor:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/"

Make sure that the three directories named Documents, Music and Videos exist in your home directory. Edit the above text block so it looks like this (the changes are highlighted in bold text):

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"

Your original question was edited by changing ~/.config/user-dirs.dirs back to its defaults after I posted this answer. As you wrote, Music is located in env and Videos is located in R, but this is not the expected result. Somehow the default paths to these three directories seem to be either duplicated or scrambled up. To help you track this problem down I have posted the results of cat '/etc/xdg/user-dirs.defaults' below:

# 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

If you've gotten this far without errors, it seems that your problem is now how to locate your missing documents. Assuming that you haven't accidentally deleted them, the easiest way to find your missing documents is to search for them manually in Files file manager. Documents might be easier to find if you search for the most common document file extensions like .odt, .doc and .pdf.

0

This doesn't work for me on Debian 11. Woke up to find my Documents folder has mysteriously vanished with everything in it. Recovery softwares don't show it among the deleted files and nor have I been able to locate it anywhere in the system.

Update I have been able to restore the Documents directory. "xdg-user-dirs-update --force" did the trick. However I lost everything in it.

1
  • It's a question, not an answer, feel free to edit the original post to add more details.
    – Yaron
    Mar 22, 2022 at 12:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .