there are several startup files which are leveraged by bash please identity the files which are used by this shell. identify the role /purpose of each file and when each files is applied/executed
/etc/profile
Here is a base /etc/profile. This file starts by setting up some
helper functions and some basic parameters. It specifies some bash
history parameters and, for security purposes, disables keeping a
permanent history file for the root user. It also sets a default
user prompt. It then calls small, single purpose scripts in the
/etc/profile.d directory to provide most of the initialization
The /etc/profile.d Directory
Now create the /etc/profile.d
directory, where the
individual initialization scripts are placed:
/etc/profile.d/dircolors.sh
This script uses the ~/.dircolors
and
/etc/dircolors
files to control the colors of file
names in a directory listing. They control colorized output of
things like ls --color. The explanation of how to
initialize these files is at the end of this section
/etc/profile.d/extrapaths.sh
This script adds some useful paths to the PATH
and
can be used to customize other PATH related environment variables
(e.g. LD_LIBRARY_PATH, etc) that may be needed for all users.
/etc/profile.d/readline.sh
This script sets up the default inputrc
configuration file. If the user does not have individual settings,
it uses the global file.
/etc/profile.d/umask.sh
Setting the umask value is important for security. Here the default group write permissions are turned off for system users and when the user name and group name are not the same.
/etc/profile.d/i18n.sh
This script sets an environment variable necessary for native language support. A full discussion on determining this variable can be found on the LFS Bash Shell Startup Files page.
/etc/bashrc
Here is a base /etc/bashrc
. Comments in the file
should explain everything you need
~/.bash_profile
Here is a base ~/.bash_profile
. If you want each
new user to have this file automatically, just change the output of
the command to /etc/skel/.bash_profile
and check the
permissions after the command is run. You can then copy
/etc/skel/.bash_profile
to the home directories of
already existing users, including root
, and set the
owner and group appropriately.
~/.bashrc
Here is a base ~/.bashrc
. The comments and
instructions for using /etc/skel
for
.bash_profile
above also apply here. Only the target
file names are different.
~/.bash_logout
This is an empty ~/.bash_logout
that can be used as
a template. You will notice that the base
~/.bash_logout
does not include a
clear
command. This is because the
clear is handled in the /etc/issue
file.
/etc/dircolors
If you want to use the dircolors
capability, then
run the following command. The /etc/skel
setup steps
shown above also can be used here to provide a
~/.dircolors
file when a new user is set up. As
before, just change the output file name on the following command
and assure the permissions, owner, and group are correct on the
files created and/or copied.
If you want to use the dircolors
capability, then
run the following command. The /etc/skel
setup steps
shown above also can be used here to provide a
~/.dircolors
file when a new user is set up. As
before, just change the output file name on the following command
and assure the permissions, owner, and group are correct on the
files created and/or copied.
Get Answers For Free
Most questions answered within 1 hours.