Chapter 3 (Using the Shell) Flashcards

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.

A

Echo

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. `

A

|

19
Q

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

A

env

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

A

Redirection

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
Q

A special tool for redirecting communication between programs is called a —

A

pipe

26
Q

A — connects the output channel of one command to the input channel of another command.

A

pipe

27
Q

$ ls /etc | sort

A

The result is that sort writes to the screen the lines from ls, sorted according to the first word in each line.

28
Q

The — command is used to display the number of characters words and lines in a text file.

A

wc

29
Q

> filename

A

Writes STDOUT output to the given file name.

(Example) ls -l > savelisting

30
Q

> > filename

A

Appends to STDOUT output to the given file name (adding it to the end of any existing file contents)
(Example) can newfile&raquo_space; existing_file

31
Q

<filename

A

Sends data from the given file name as the STDIN, rather than reading from the keyboard.
(Example) my_script<input_codes

32
Q

You can use the — command to write the contents of any file to the screen.

A

cat

33
Q

(Note) Using the append operator, you can add the small file to the end of the larger file.

A

(Example)

$ cat small_file&raquo_space; large_file

34
Q

The — command lets you redirect output to a file and also to the screen.

A

tee

35
Q

$ sort data_file | tee sorted_data

A

The following command displays the output of the sort command and also writes it to the file sorted_data

36
Q

$ sort data_file | tee -a sorted_data

A

You can have the tee command append data to the end of the named file by adding an -a option.