103.1 Work on the Command Line Flashcards

1
Q

What are four shells

A
  • bash (bourne again shell)
  • csh (C style syntax)
  • ksh (Bourne Shell + C shell)
  • zsh (Bash shell + Korn shell)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you turn on debugging?

A

set -x

To turn off set +x

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

Write a function that return “yo” to the screen. Then remove it.

A
function yo() {
  echo yo
}

unset -f yo

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

How do you export a variable to the current shell and any new shells started from the current shell?

A

export YO=yo

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

What is the environment variable that contains the number of lines that the .bash_history will contain.

A

HISTFILESIZE

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

File located in the user’s home directory that contains the previously run commands.

A

.bash_history

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

How do you view the bash history?

A

history

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

What are the 8 sections of the man pages

A

S1 - Executable programs or shell commands
S2 - System Calls - Functions provided by the kernel
S3 - Library calls - Functions within program libraries
S4 - Special Files - Typically those found in /dev
S5 - File formats and conventions - for exaple /etc/passwd and other configuration files
S6 - Games
S7 - Miscellaneous items and conventions (man regex)
S8 - System administration commands - only for root

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

How do you search the man pages for a keyword?

A

apropos
or
man -k

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