Back up a second. /etc/bash.bashrc
is the system-wide settings file for bash. $HOME/.bashrc
(often abbreviated as ~/.bashrc
) has your user's personal settings. ~/.bashrc
is read everytime you start a new shell (open a terminal) and so is /etc/bash.bashrc
, you don't need to copy anything from one to the other, both will be read.
So, if your system has no ~/.bashrc
, all you need to do is create one and add the relevant line to it:
echo ". ~/z.sh" >> ~/.bashrc
That's it.
The .
is an alias to bash's source
:
source: source filename [arguments]
Execute commands from a file in the current shell.
Read and execute commands from FILENAME in the current shell.
. ~/z.sh
--- I get:-bash: z: command not found
. ~/z.sh
in one for that./home/user/z.sh
or similar.