103.1 Command Line (Shells, Sourcing, Special Characters) Flashcards

1
Q

bash

default linux shell used to interpret the commands and scripts on system

A

bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

other shells
ash
c-shell
ksh
zsh

A

other

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

special shells

caution this will NOT exist if you add it and you won’t be able to login

A

/bin/false/etc/nologin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

Bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

go out of scope

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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)

A

CURRENT shell’s env

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

script sourcing

allows anything set with that shell to remain set

A

once completed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

/etc/profile

system wide config script that will affect each user’s env provided they use the bash shell

A

/etc/profile

sourced script and executed each time a user logs in through the login shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

/etc/bashrc

system wide config script that affects each users env as long as they use the bash shell

A

/etc/bashrc

source script and executed each time a user logs in through a login shell or executes a non-login session

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

~/.bash_profile

sourced script executed when a user logs in through a login shell but ONLY affects the user logging in

A

~/.profile

~/.bash_login

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

~/.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

A

~/.bashrc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

~/.bash_logout

sourced script on that is executed when the following commands executed

A

logout

exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

session order step 1

user

A

login

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

session order step 2

/etc/profile

A

sourced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

session order step 3

user ~./bash_profile

A

sourced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

session order step 4

user ~/.bashrc sourced from

A

~/.bash_profile

17
Q

session order step 5

user performs tasks

A

as needed

18
Q

session order step 6

user logs out with

A

logout
or
exit

19
Q

session order step 7

user ~/.bash_logout

A

sourced

20
Q

non login session

when root or other user uses SU command to become another user or root user then by default does not load

A

full env

21
Q

command complation

typing any command in the system path or any valid path partially and pressing this key will attempt to autocomplete the the remainder of the command or path

A

<TAB>
</TAB>

22
Q

command exit code

every command succeeds or fails and provides an exit code that you can see

echo $

A

0 == success

1 or > == failure