103.1 Command Line (Shells, Sourcing, Special Characters) Flashcards
bash
default linux shell used to interpret the commands and scripts on system
bash
other shells
ash
c-shell
ksh
zsh
other
special shells
caution this will NOT exist if you add it and you won’t be able to login
/bin/false/etc/nologin
script execution
reads contents of the file indicated and if proper permission set the commands within it are executed one by one as if typed on a command line but in a new shell
Bash
script execution
this will happen to variables set within the execution space during the script once the script is complete and exits back to the command prompt
go out of scope
script sourcing
Bash reads the contents of the file indicated and, if the proper permissions are set, the
commands within it are executed one by one (like they were typed on the command line)
CURRENT shell’s env
script sourcing
allows anything set with that shell to remain set
once completed
/etc/profile
system wide config script that will affect each user’s env provided they use the bash shell
/etc/profile
sourced script and executed each time a user logs in through the login shell
/etc/bashrc
system wide config script that affects each users env as long as they use the bash shell
/etc/bashrc
source script and executed each time a user logs in through a login shell or executes a non-login session
~/.bash_profile
sourced script executed when a user logs in through a login shell but ONLY affects the user logging in
~/.profile
~/.bash_login
~/.bashrc
sourced script usually called by !/.bash_profile script
sources the /etc/bashrc if it exists
used to customize shell prompt, kb shortcuts command line aliases
~/.bashrc
~/.bash_logout
sourced script on that is executed when the following commands executed
logout
exit
session order step 1
user
login
session order step 2
/etc/profile
sourced
session order step 3
user ~./bash_profile
sourced