Chapter 5 Flashcards

(11 cards)

1
Q

Which

A

use the which command to display the full path to the command in question:

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

External commands

A

binary executables stored in directories that are searched by the shell. The ls command, then the shell searches through the directories that are listed in the PATH variable to try to find a file named ls that it can execute.

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

type

A

displays the location of the command

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

-a option of the type

A

displays all locations that contain the command named

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

alias

A

determine what aliases are set on the current shell

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

alias name=command

A

New aliases can be created using the following format, where name is the name to be given the alias and command is the command to be executed when the alias is run

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

function_name ()
{
commands
}

A

function_name can be anything that the administrator wants to call the function. The commands that the administrator wants to execute can replace the commands placeholder.

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

Double quotes

A

Double quotes stop the shell from interpreting some metacharacters (special characters), including glob characters.

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

Glob characters, also called wild cards,

A

are symbols that have special meaning to the shell; they are interpreted by the shell itself before it attempts to run any command. Glob characters include the asterisk * character, the question ? mark character, and the brackets [ ], among others.

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

Single quotes

A

prevent the shell from doing any interpreting of special characters, including globs, variables, command substitution and other metacharacters that have not been discussed yet.

sysadmin@localhost:~$ echo The car costs $100
The car costs 00
sysadmin@localhost:~$ echo ‘The car costs $100’
The car costs $100

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

Backslash Character

A

Prevents $1 being interpreted as a special character

echo The service costs $1 and the path is $PATH
The service costs $1 and the path is /usr/bin/custom:/home/sysadmin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

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