I've declared an alias in
.bashrc file located in my home directory. Export of
PS1 environment variable has been added to this file too.
# /etc/skel/.bashrc # # This file is sourced by all *interactive* bash shells on startup, # including some apparently interactive shells such as scp and rcp # that can't tolerate any output. So make sure this doesn't display # anything or bad things will happen ! # Test for an interactive shell. There is no need to set anything # past this point for scp and rcp, and it's important to refrain from # outputting anything in those cases. if [[ $- != *i* ]] ; then # Shell is non-interactive. Be done now! return fi # Put your fun stuff here. alias ll='ls -l' export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \W \$\[\033[00m\] '
However, these changes don't have any effect. I don't have the alias declared in the file after logon.
$PS1 isn't affected too. AFAIK user's
.bashrc script is sourced by
.bash_profile script located in the user's home directory. So I've added the following line to my .bash_profile for testing purposes:
echo hello > ~/test.txt
Here is full content of my
# /etc/skel/.bash_profile # This file is sourced by bash for login shells. The following line # runs your .bashrc and is recommended by the bash info pages. echo hello > ~/test.txt [[ -f ~/.bashrc ]] && . ~/.bashrc
test.txt doesn't appear in my home directory after logon. It seems that the .bash_profile isn't called during logon.
How to set the system to take user's
.bash_profile into account?