Sunday 26 August 2018

bash - No bashrc file in my home directory


Here is what I noted down from my lecture:



  • Find file .bashrc in your home directory

  • do vi .bashrc

  • When you put an application folder somewhere, make sure that its address is in the path variable.


The problem is that I do not have a .bashrc file in my home directory. There is only a .bash_history file in my home.


If i go to the root, there is a etc/bash.bashrc file there but what i think is that it will make changes for all users and not just for me. I want to add this path just for myself. It shouldn't effect others. Also there is no $PATH variable in that bashrc file so I am even more confused.



Answer



Don't forget it is a hidden file inside your home directory (you would not be the first to do a ls -l and thinking it is not there).


Do following ...


ls -la ~/ | more

There should be a .bashrc on the first page. If not just create it with


vi ~/.bashrc

And simply write following line into it.


PATH=$PATH:~/bin



OR Most of the distributions keep a standard .bashrc file in /etc/skel/ You can copy it to home directory.


$cp /etc/skel/.bashrc ~

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...