I'm working on a bash script tied to /etc/profile
but instead of appending, I accidentally wrote over it, losing all its contents. How can I restore the file?
1 Answer
You can find the template of /etc/profile
in /usr/share/base-files/profile
If you want to restart with a new one, you can easily copy it :
sudo cp /usr/share/base-files/profile /etc/profile
-
1The files in
/etc/skel
are copied to the home directories of new users. The file/etc/profile
is a system-wide configuration file and somewhat different.– mook765Mar 27, 2018 at 14:51 -
@mook765 They updated the answer with a file that does match the default
/etc/profile
. May 15, 2018 at 23:27 -