What does .bashrc file in unix/linux do ? what steps should i take inorder to run some commands automatically everytime i open my terminal??
It's a bash file, kinda like how Windows uses bash files.
It controls the behavior of the bash shell by setting up environment variables, prompt, and shell procedures. For some more detail try this: http://tldp.org/LDP/abs/html/sample-bashrc.html
When you login, if your login shell is BASH, your environment is set to the values in /etc/bashrc. ~/.bashrc is read afterwards allowing the user to customize their environment and override settings that /etc/bashrc made.
so i just got to ~/.bashrc edit it by writing the commands in it like setting up alias and all, and i am done ?
I'm late to the game but... Basically any command that would work in bash can be put in the .bashrc file and it would be run when bash starts.
Yes, you can set up aliases, change your prompts, pretty much anything you want. Of course, with this freedom, you can goof things up pretty good too.
Join our real-time social learning platform and learn together with your friends!