Where are the pristine, untouched contents of a ~/.profile file?
In /etc/skel/
. This is the user "skeleton" used when creating a new user. On a regular Ubuntu installation it looks like this:
/etc/skel
├── .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 byuseradd
.
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.