How to safely remove default folders?

10,306

Yes. See post #7 in your link.

Backup the config file (optional):

cp ~/.config/user-dirs.dirs ~/.config/user-dirs.dirs.bak

Edit the file by commenting out unnecessary entries:

vim ~/.config/user-dirs.dirs

Run update command:

xdg-user-dirs-update

DO NOT REMOVE XDG_DESKTOP_DIR

Share:
10,306

Related videos on Youtube

Torinouq
Author by

Torinouq

Updated on September 18, 2022

Comments

  • Torinouq
    Torinouq over 1 year

    In the File Manager (Xubuntu 12.04), I can see some default folders which I don't need (like Videos, Music, ...). Is it safe to remove them or might programs not work properly afterwards (like on Mac OS X where I tried that once)?

    I found this thread on Ubuntu Forums How to permanently delete folders "Music, Videos, Documents,...." (through Nautilus) . Is this the way one should remove these folders?

    • Admin
      Admin almost 12 years
      he's probably talking about the once in /home/$USER (ie. Desktop, Downloads) @alvar
    • Admin
      Admin almost 12 years
      Sorry, I completely forgot (I updated the post). Indeed, I meant precisely those in ~/.config/user-dirs.dirs
    • Admin
      Admin almost 12 years
      It's better to state the folders in the question rather than linking to an external site.
    • Admin
      Admin almost 12 years
      Thanks, I stated them. The link is necessary for my last question.
  • balu
    balu over 6 years
    This does not do what OP asked. xdg-user-dirs-update will simply update ~/.config/user-dirs.dirs (and might, in particular, override some of OP's modifications from before), not create/rename/remove any directories as the above instructions suggest. See man xdg-user-dirs-update for information on what it does exactly. The actual answer should be: Simply remove the folder. (Running xdg-user-dirs-update is not necessary as it will be run upon the next user login, anyway, see ~/.config/user-dirs.conf.)
  • Abhimanyu Pallavi Sudhir
    Abhimanyu Pallavi Sudhir almost 6 years
    Doesn't work -- even if you don't run the update command, it gets updated upon the next reboot. There must be a more fundamental file in which these directory names are kept.
  • Abhimanyu Pallavi Sudhir
    Abhimanyu Pallavi Sudhir almost 6 years
    See here for a working solution. If you also want to remove the folders from the home directory, edit user-dirs.defaults, or make a copy of it in .config and edit there (for your local user).