05 Commands Flashcards

1
Q

In Linux, “commands” refers to any of four different subtypes. What are those subtypes?

A
  1. An executable program (like those in /usr/bin)
  2. A shell “built-in”
  3. A shell function
  4. A command alias
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an executable program?

A

A compiled binary written in a programming or scripting language. Typically located in /usr/bin

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

What is a shell built-in?

A

Shell built-ins are written into the shell itself.

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

What is an example of a shell built-in?

A

cd

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

What is a shell function?

A

A miniature shell script, incorporated into the shell environment

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

What is an alias?

A

A user-defined command, often built using other commands.

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

What is the purpose of the “type” command?

A

The “type” command is a shell built-in that displays a commands subtype.

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

What is the purpose of the “which” command?

A

“which” displays an executables path location. note that “which” only works for executables, not built-ins, aliases, etc.

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

What is an “alias”

A

an alias is a command built from other system commands, separated by semicolons

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

What is the method for creating an alias?

A

Aliases take the form “alias name=’string’ “

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

What should you do immediately prior to creating an alias?

A

Check to see if the intended alias is already resident on the system. One way to do that is “ type alias “

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

How would you list all available aliases created on a system?

A

Simply entering the “alias” command followed by ENTER

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

How would you remove an alias if you no longer wished to use it?

A

unalias foo

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