Chapter 3 (Using the Shell) Flashcards

(36 cards)

1
Q

A — is like a program or a macro

A

Script

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

A — is essentially a list of commands stored in a text file.

A

Script

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

The default shell for all Linux systems is —

A

Bash

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

Changing to a new default shell is very easy using the — command.

A

usermod

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

The – — records each command that you enter at the shell prompt.

A

Command History

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

The — command displays the entire history list, which normally includes at least — commands

A

History, 1000

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

A exclamation point is sometimes called a – in unix and Linux

A

bang

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

The — script contains configuration information that applies to every user on the system.

A

/etc/profile

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

Each users home directory can contain another start-up script called—

A

.profile

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

The — script is executed each time the user starts a bash shell.

A

.bashrc

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

(Bash Scripts)

— is executed each time a bash shell is started.

A

.bash_default

.bash_login

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

(Bash Scripts)

— is executed each time a user closes a bash shell

A

.bash_logout

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

A — is a string of characters that is substituted for another string of characters at the shell prompt.

A

Alias

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

The — command lets you define how the shell will substitute one string of text for another string of text that you enter at a shell prompt.

A

Alias

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

(Alias example)

A

alias muont=mount

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

The — command writes text to the screen.

17
Q

As used in a Linux shell, is a name that can have a value assigned to it.

A

Shell variable

18
Q

(Note)

Variables are typically created using all uppercase letters, though they don’t have to be. `

19
Q

You can use the — command to start a program with an environment variable setting that is not part of your current environment.

20
Q

An — — is a variable that has typically been defined (assigned a value) as part of the process of initializing either the operating system or the particular shell in which a user is working.

A

Environment Variable

21
Q

The — command displays a list of all environment variables defined in your current environment.

A

set

Example $ set

22
Q

Channels of communication in Linux can be redirected, however, using — operators

23
Q

When a program expects input such as a line of text, it reads that information from the standard — – – channel.

A

Standard Input channel (abbreviated STDIN)

24
Q

When a program generates output, it normally sends it to the — — —

A

Standard output channel (abbreviated STDOUT)

25
A special tool for redirecting communication between programs is called a ---
pipe
26
A --- connects the output channel of one command to the input channel of another command.
pipe
27
$ ls /etc | sort
The result is that sort writes to the screen the lines from ls, sorted according to the first word in each line.
28
The --- command is used to display the number of characters words and lines in a text file.
wc
29
> filename
Writes STDOUT output to the given file name. | (Example) ls -l > savelisting
30
>> filename
Appends to STDOUT output to the given file name (adding it to the end of any existing file contents) (Example) can newfile >> existing_file
31
Sends data from the given file name as the STDIN, rather than reading from the keyboard. (Example) my_script
32
You can use the --- command to write the contents of any file to the screen.
cat
33
(Note) Using the append operator, you can add the small file to the end of the larger file.
(Example) | $ cat small_file >> large_file
34
The --- command lets you redirect output to a file and also to the screen.
tee
35
$ sort data_file | tee sorted_data
The following command displays the output of the sort command and also writes it to the file sorted_data
36
$ sort data_file | tee -a sorted_data
You can have the tee command append data to the end of the named file by adding an -a option.