Results 1 to 5 of 5
Thread: .bashrc .bash_profile
Enjoy an ad free experience by logging in. Not a member yet? Register.
I'm reading a couple of tutorial books to help advance my Linux skills.
Now, the books keep mentioning the .profile file in the Home folder and /etc/profile.
I found /etc/profile but can't find .profile. The only likely files I can find in the home directory are .bashrc and .bash_profile. Which does what? and which is instead of .profile?
- Join Date
- Jan 2007
"When bash is invoked as an interactive login shell, or as a non-interac‐
tive shell with the --login option, it first reads and executes commands
from the file /etc/profile, if that file exists. After reading that file,
it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that
order, and reads and executes commands from the first one that exists and
is readable. The --noprofile option may be used when the shell is started
to inhibit this behavior."
from "man bash"
> which is instead of .profile?
.bash_profilethe sun is new every day (heraclitus)
OK, so what does .bashrc do? Because I have this line in .bash_profile:
if [ -f ~/.bashrc ]; then . ~/.bashrc fi
Check if .bashrc file exists in your home folder.
I know it exists, I've edited it before.
# .bashrc # User specific aliases and functions # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi #Fortune if [ -x /usr/games/fortune ]; then /usr/games/fortune -s fi #Sets the CapsLock key so that it acts like a backspace setxkbmap -option caps:backspace