1

I have messed with /etc/skel files and stupidly didn't back it up! I need to restore the original files in this directory! How can I find the original files over the internet?

Note: for security reasons only provide Linux official link.

Thanks in advance.

Anwar
  • 77,855
dariush
  • 619

2 Answers2

7

The files /etc/skel/.bashrc, /etc/skel/.bash_logout and /etc/skel/.profile are provided by package bash.

You need to get the bash package and extract the files from it and copy them back in /etc/skel.

  1. Get the bash package's deb file.

    apt-get download bash
    
  2. Then extract the package to /

    sudo dpkg-deb -x bash_4.3-14ubuntu1.1_amd64.deb /
    

    Replace the actual package file name in the above command, if your deb file name isn't exactly same.

Anwar
  • 77,855
1

You can always get the skel files from your home user dir because , at the time of user creation all skel files will be copied to the new users home directory. So as of now you can find files/ folders in your early created user home directory. Probable folders/files in /etc/skel/ are as follows:

.bash_logout  
.bashrc  
.config  (directory)
.profile  

These files and folder will be there in /home/username/ where the dot(.) infront of it indicates they are hidden. Just take a look and copy back to /etc/skel/ . Thats it.

SAGAR Nair
  • 1,415