Delete . bashrc, . bash_profile and . profile files: what are the consequences?

Asked

Viewed 579 times

2

I’ve been trying to install the Ruby and the Ruby on Rails through the RVM but during the installation process I had some problems. I tried to uninstall the RVM through the commands :

rvm implode 

gem uninstall rvm

After performing these commands, I thought it was to delete the files .bashrc ; .bash_profile ; .profile so I did it.

When I tried to reinstall RVM these files did not return. How should I proceed, since I have to configure the:

.bashrc :

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

.bash_profile :

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

PS.: I’m starting on Ubuntu, so I followed these tips initially: https://stackoverflow.com/questions/3558656/how-can-i-remove-rvm-ruby-version-manager-from-my-system

  • Comment only (:P): these files only influence the shell patron, the bash. You can try using others one day.

3 answers

4

These files are part of the system and serve to set a configuration to the terminal when you open it. RVM changes them to include in the PATH and can be executed directly even if it is in your home.

There is a copy of their originals in the directory /etc/skel of the system, get them there!

  • Hello William, in this directory you indicated me only manage to find the files: . bashrc and the .profile. Where I find the . bash_profile ?

2

These files configure the environment with user preferences. A priori, deleting these files does not affect the operating system, but can cause common executable commands not to be recognized.

0

If you are using graphical environment and therefore only virtual terminals with Interactive shell, the .bash_profile should not be missed. Just like the .bashrc and the .profile which serve to customize your environment (type env to see all set variables), set aliases and run a program you like when you open a new terminal (for example, mott or cowsay ), the .bash_profile will only run when you use a login shell (ssh or by logging into the Ttys - ALT+F1 , ALT+F2, etc...)

If you’re really going to use one login shell, copy the .bashrc to the .bash_profile.

$ cd ~
$ cp .bashrc .bash_profile

Or create a link:

$ cd ~
$ ln -s .bashrc .bash_profile

Browser other questions tagged

You are not signed in. Login or sign up in order to post.