I messed up my ~/.bashrc file and am trying to restore it.
I tried doing this:
cp ~/.bashrc ~/.bashrc_bak
cp /etc/skel/.bashrc ~/
source .bashrc
but I get this error:
cp: /etc/skel/.bashrc: No such file or directory
I looked in /etc
but there's no skel
file there.
I'm a complete beginner. Thanks for your help.
As you might already know, there is a default version of the bashrc file in the /etc/skel/ directory in Ubuntu. So if you have problems with bashrc file, you can easily restore it to its default settings like below.
From a login or other node on the cluster, type nano ~/. bashrc to open the file in the nano editor. My . bashrc has already been added to, so you'll see additional definitions below the # User specific aliases and functions section.
The . bashrc file is a script file that's executed when a user logs in. The file itself contains a series of configurations for the terminal session. This includes setting up or enabling: coloring, completion, shell history, command aliases, and more. It is a hidden file and simple ls command won't show the file.
Type the following in your terminal,
/bin/cp /etc/skel/.bashrc ~/
It will replace your corrupt ~/.bashrc
with a fresh one. After that you need to source the ~/.bashrc
so that the change take place immediately, write in terminal,
source ~/.bashrc
or if that does not work you can close the terminal and open it again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With