linuxbashrhel8

How to re-create .bashrc


I accidently deleted .bashrc from my user. Is there any way to create it again.

I used command touch .bashrc to create the file again and also given the required data inside the file. But it is not working.

Can anyone tell me how to recreate the file?


Solution

  • In RHEL, you can find the default content of a home directory in /etc/skel:

    $ ls -la /etc/skel
    total 24
    drwxr-xr-x.   3 root root   78 Mar 29 17:07 .
    drwxr-xr-x. 149 root root 8192 May 25 11:24 ..
    -rw-r--r--.   1 root root   18 Jun 20  2022 .bash_logout
    -rw-r--r--.   1 root root  141 Jun 20  2022 .bash_profile
    -rw-r--r--.   1 root root  376 Jun 20  2022 .bashrc
    drwxr-xr-x.   4 root root   39 Mar 29 17:07 .mozilla