101 exam - terms Flashcards

1
Q

Other shells

A

Bash (Boutne again shell)

Dash (Debian Almquist shell, smaller without comman-line editing or command history, faster script execution)

KornShell (compatible with bash, supports advanced programming features)

tcsh (TENEX C shell - upgraded version of C shell, incorporates elements from the C languages into shell scripts)

Z shell (incorporates features from bash, tcsh, KornShell, adv. prog. features, and many others)

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

Metacharacter $

A

Indicates a variable, with echo command it tries to retrieve the value and display it.

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

Shell quoting

A

Shell quoting allows you to use metacharacters as regular characters. \ for single metacharacter or ‘ and “ for multiple metacharacters

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

How to tell it’s internal (to the sell) or external command

A

type -command-
ex:
$ type pwd
pwd is a shell builtin

$ type uname
uname is /usr/bin/uname

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

Environment variables

A

Environment variables track specific system information, such as the name of the user
logged into the shell, the default home directory for the user, the search path the shell uses to find executable programs, and so on.

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

Executing a program outside the PATH directories

A

provide the absolute path
ex:
$ /home/Christine/Hello.sh
Hello World

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

which utility

A

It searches through the PATH directories to
find the program. If it locates the program, it displays its absolute directory reference.
$ which Hello.sh
/usr/bin/which: no Hello.sh in (/usr/local/bin:/usr/bin:
/usr/local/sbin:/usr/sbin:/home/Christine/.local/bin:/home/Christine/bin)

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

changing the environment variable

A

enter the variable’s name, followed by an equal sign (=), and then type the new value (this setting will not survive entering into a subshell)
ex. of changing PS1 (shell promt):
$ PS1=”My new prompt: “
My new prompt:

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

To preserve an environment variable’s setting

A

export -variable name-

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

Using the grep command and a digit character class

A

grep [[:digit:]] random.txt

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

Matches any uppercase alphabetic characters, and is equal to using the [A-Z] bracket expression

A

[:upper:]

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

Redirect STDIN from specified file into command.

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

Redirect STDOUT and STDERR to specified file. If file exists, overwrite it. If it does not exist, create it.

A

&>

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

Redirect STDIN from specified file into command and redirect STDOUT to specified file.

A

<>

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

Redirect STDOUT to specified file. If file exists, overwrite it. If it does not exist, create it.

A

>

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

Redirect STDOUT to specified file. If file exists, append to it. If it does not exist, create it.

A

> >

17
Q

Redirect STDERR to specified file. If file exists, overwrite it. If it does not exist, create it.

A

2>

18
Q

Redirect STDERR to specified file. If file exists, append to it. If it does not exist, create it.

A

19
Q

Redirect STDOUT and STDERR to specified file. If file exists, append to it. If it does not exist, create it.

A

20
Q

Matches any alphanumeric characters (any case), and is equal to using the [0-9A-Za-z] bracket expression

A

[:alnum:]

21
Q

Matches any alphabetic characters (any case), and is equal to using the [A-Za-z] bracket expression

A

[:alpha:]

22
Q

Matches any blank characters, such as tab and space

A

[:blank:]

23
Q

Matches any numeric characters, and is equal to using the [0-9] bracket expression

A

[:digit:]

24
Q

Matches any lowercase alphabetic characters, and is equal to using the [a-z] bracket expression

A

[:lower:]

25
Q

Matches punctuation characters, such as !, #, $, and @

A

[:punct:]

26
Q

Matches space characters, such as tab, form feed, and space

A

[:space:]