The Pictures directory is missing in the sidebar of the file manager and when I use terminal to do cd ~/Pictures it shows /home/sm/Pictures: No such file or directory.

I am using Ubuntu 16.04 and my Pictures directory was existing last week.

Here's how the file manager's side bar looks:

list of folders/directories in sidebar: Recent, Home, Desktop, Downloads, Music, Videos, Trash, Network, Computer, Myfile, win, Connect to...

  • 1
    Can you please do cat ~/.config/user-dirs.dirs and tell us what does it say ? Is XDG_PICTURES_DIR defined there or not ? Have you installed any new software or ran any commands such as rm that could operate on ~/Pictures ? – Sergiy Kolodyazhnyy Oct 27 '17 at 19:17
  • thanks . after run cat ~/.config/user-dirs.dirs it shows to me also XDG_PICTURES_DIR="$HOME/" and i don't think thar run rm for ~/Pictures – smr Oct 27 '17 at 19:25

Your XDG_PICTURES_DIR="$HOME/" should be XDG_PICTURES_DIR="$HOME/Pictures", so open that cat ~/.config/user-dirs.dirs file in text editor, and correct the issue. After logging out and logging back in ( if simply logging in/out doesn't work , try reboot), new ~/Pictures folder should be created and show up in file manager.

As for the old one, it's a mystery where it may have disappeared and probably whatever files you had there are gone with it.

|improve this answer|||||
  • By gedit cat ~/.config/user-dirs.dirs i opened this and change XDG_PICTURES_DIR="$HOME/" to XDG_PICTURES_DIR="$HOME/Pictures" But after logout did not change . and when run cat ~/.config/user-dirs.dirs it shows XDG_PICTURES_DIR="$HOME/" and Pictures dir missing . – smr Oct 27 '17 at 19:44
  • OK, try this instead in terminal : sed -ir 's;(XDG_PICTURES_DIR=.*)\";\1Pictures\";g' ~/.config/user-dirs.dirs That's one in \1, don't confuse it with letter l ! Then log out and log in. If that doesn't work, you've more serious problem where your user-dirs.dirs file is being over written all the time – Sergiy Kolodyazhnyy Oct 27 '17 at 20:21
  • I Copied that in terminal and it shows sed: -e expression #1, char 40: invalid reference \1 on s' command's RHS` – smr Oct 27 '17 at 20:35
  • @cooder sorry, my bad, you need to separate -i and -r , it should be sed -i -r , separately – Sergiy Kolodyazhnyy Oct 27 '17 at 20:39
  • Yes ... thanks a lot @sergiy . my problem fixed . What was the problem ? ! – smr Oct 27 '17 at 20:44

For me it was a multi-step step process:

  1. Open a terminal window in the Home directory
  2. In the terminal window create the new Pictures folder:

    mkdir Pictures
  3. Open user-dirs.dirs in ~/.config
  5. Save and close user-dirs.dirs in ~/.config
  6. In the terminal window, execute xdg-user-dirs-update to make certain it does not change anything.
  7. Reopen user-dirs.dirs to make certain it did not change XDG_PICTURES_DIR="$HOME/Pictures" back to XDG_PICTURES_DIR="$HOME/"
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.