Several files in my home directory have been disappearing. E.g. .bashrc, .bash_profile, authorized_keys and now .profile.

Regardless of how this happened, I would like to restore the original pristine .profile file. If I create a new user on my system one is created. Where can I find this .profile contents from a fresh, untouched install?

  • Severa files have been disappearing? – user25656 Jul 12 '13 at 10:18

In /etc/skel/. This is the user "skeleton" used when creating a new user. On a regular Ubuntu installation it looks like this:

├── .bash_logout
├── .bashrc
└── .profile

If you add files here yourself it will be put in the home directory of newly created users. To restore the default, simply copy it from there:

cp /etc/skel/.profile ~/

Se also the useradd manpage on this:

The system administrator is responsible for placing the default user files in the /etc/skel/ directory (or any other skeleton directory specified in /etc/default/useradd or on the command line).

-k, --skel SKEL_DIR The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is created by useradd.

While strictly not in scope for your question, but noteworthy is, also the system-wide profile file (/etc/profile) is evaluated on login as Johankor mentions in his answer.

  • tks gertvdijk :=] – Jay Jul 12 '13 at 9:23

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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