Chapter 5 - CLI skills Flashcards

1
Q

What is the difference between an Alias and Variable?

A

Variable stores data in the form of strings.
Alias is a shortcut for a longer command

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

-How do you create a local variable?
-And how do you view its value in CLI?

A

-variable=value
-echo $variable

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

-How do you create an Environment variable?
-And how do you view its value in CLI?

A
  • export variable
    -env | grep variable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you remove an exported ENV variable?

A

unset variable

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

What is the purpose of the which command?

A

Used to determine if there is an executable file, in this case named date, that is located within a directory listed in the PATH value.

output is a file path –>

sysadmin@localhost:~$ which date
/bin/date

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

what directories store external commands in linux?

A

externals are generally stored in /bin, /usr/bin, or /usr/local/bin.

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

W

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

What is the difference between a built-in program and an executable?

A

A builtin is a command or function that is executed directly in the shell itself.

An external executable program is loaded by the shell and then executed.

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