Automatic folder creation upon first login


When I create a new user account and login the first time to Gnome a series of files and directories is created in the user’s home directory. Those directories are for example:


How can I control what files and directories are created? I checked /etc/skel but none of those entries where there. In particular, I do not want to have the folders “Bilder”, “Documents”, “Musik”, “Videos”, “Vorlagen” and “Öffentlich” being created.

Googling around did not help.

Thank you for advice.

I quite agree; although I guess the hidden folders might be necessary for some reason I don’t know.

On KDE the initial effect is cheap and unpleasant, imitating Windows’ disgusting ‘My Music’, ‘My Documents’ etc. from 1998. I am capable of creating which folders I wish and resent being told where I should put things according to some ridiculous universal pattern. I assumed MS did this in order to facilitate spying.

The good news is that they can be deleted immediately without a second thought. Prolly not the hidden files with a . before.

Just delete the ones you don’t want.

Hidden folders /.foldername
will just get re-created and boot or start of application.

Isn’t there an /etc/skel or something that controls what folders to make when a new user is created?

Some of them are simply needed by the desktop. No Gnome without a .conf folder etc. Some of them are created because a lot of desktop apps expect them to be there.

Me, I was perfectly satisfied with a ‘Documents’ folder. One day in KDE4, I suddenly have a ‘Documenten’ folder (yeah, dutch is nothing but english with the ‘s’ replaced by ‘en’), and some of the KDE4 apps default to the new folder, so files get dropped there etc. etc.

you just need to find where the skeleton which is used to make new
users is kept, i used to know, but now can’t find it, but this might

if not, this search gives other hits:

and, i guess you can figure some other search strings that give more

ps: unless you know exactly what they are for and how to get around
needing them, i’d not mess with the skeleton’s hidden files!



thanks for the many replies. As mentioned, the /etc/skel directory is no solution.

As I cannot expect the users to delete folders unwanted by system administration but also set 500 rights on the home directory of the common user, I will write a cron-job that will sweep through their home directories and delete all unwanted folders every one minute or so.

The folders that are created in ~ with the DOT prefix are hidden folders or directories that contain configuration information for software that you use. Deleting them would be like running the application for the first time. It is created in ~ to simplify the per user configurations for each application.

Your .gnupg will contain information on how YOU use gnupg along with your keys.

Not all software require the use of these hidden items; the ones that do are the ones you see in your ~.

How would I remove them on a System Wide range? VI the /etc/bashrc or /etc/profile file with the following command at the bottom before it references ~/.bashrc:
rm -rf file_or_directory;

To be user specific enter that line in to the users ~/.bashrc file. These files are simply BASH scripts that are run prior to entering a shell or desktop. They were orginaly created to “prep” the environment in bash for the user.

Doing that will remove the specified item every time anyone (including root) logs in or enters a shell. BE CAREFUL ON WHICH ITEMS YOU DELETE!

Take a look at xdg-user-dirs package, and it’s configuration: /etc/xdg/user-dirs.defaults. You can choose what directories should be created or simply disable it.