Currently If i have created new userID then .bash_profile file is created under the new user.
Now, I would like to add one path in this file.
Please help on this .
Current file output:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
CASE_PRIMARY_GROUP=cccccc
Expect output:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
if [ -f $HOME/script.sh ]; then
. $HOME/script.sh
fi
PATH=$PATH:$HOME/bin
export PATH
CASE_PRIMARY_GROUP=cccccc
Now I have created userId as sk14 in linux box. Then .bash_profile file created under /home/sk14 directory . if i see that file then i can see the below entry.
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH CASE_PRIMARY_GROUP=cccccc
Note: This is a default entry for all newly created user.
I would like to change that file when will i create any new user ?.
tip: please wrap codes in code tags to make it easy to read.
run this command:
useradd -D|grep SKEL
the output is your skel directory, usually it would be /etc/skel.
When you are creating new user, the file under that directory will be copied to user's home as default profile, bashrc ... etc.
Go to that directory, change the related file you want to use for creating new users.