0

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?

Byte Commander
  • 105,631
  • 46
  • 284
  • 425
reynarice
  • 11
  • 2

1 Answers1

3

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
mook765
  • 14,911
  • 5
  • 35
  • 67
Félicien
  • 1,163
  • 1
  • 10
  • 18
  • 1
    The 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. – mook765 Mar 27 '18 at 14:51
  • @mook765 They updated the answer with a file that does match the default `/etc/profile`. – Chai T. Rex May 15 '18 at 23:27
  • @ChaiT.Rex Thanks, removed downvote, edited and upvoted... – mook765 May 15 '18 at 23:43