When I create a new user, how do I tell Ubuntu not to create a Public sub-folder?


Preventing the creation of content folders

As you may have noticed, Ubuntu has a few "special" folders for certain types of content.

Special directories

These will appear in new user accounts, and auto-recreate (in certain situations) for existing users. However, this behavior can be configured.

For new users

Open /etc/xdg/user-dirs.defaults in your preferred text editor, with administrator privileges. You will see something close to this:


This is a system description of the default content folders to create for new users. If you replace any directory here with the home folder, new users will not have that folder created on first login.

For example, to prevent new users from getting a Public folder:


For existing users

Use the same process as above, but edit the .config/user-dirs.dirs in the user's home folder instead. This method does not require administrative privileges, and will prevent content directories from being recreated after user deletion.

Technical reading

  1. The XDG User Directories specification
  2. "How can I change the default location of content directories in my home folder?"
| improve this answer | |

The XDG specified directories, as described by Jacob, are not created with the account, they're created (and recreated if missing) when the user logs in. Pointing those user-dirs variables at $HOME is a workaround, but it doesn't actually disable the functionality; if disabling is what you want, you can change "enabled=True" to "enabled=False" in /etc/xdg/user-dirs.conf. As the comment in that file above the definition says,

# This controls the behaviour of xdg-user-dirs-update which is run on user login
# You can also have per-user config in ~/.config/user-dirs.conf, or specify
# the XDG_CONFIG_HOME and/or XDG_CONFIG_DIRS to override this

Note that you'll probably also need to uninstall gnome-user-share for this to actually work.

| 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.