Ch.6 Redirection Flashcards

1
Q

What does I/O stand for

A

Input/output

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

What does I/P redirection allow us to do?

A

Redirect the input and output of commands to and from files, as well as connect multiple commands together

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

What does cat do

A

Concatenate files

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

what does sort do?

A

Sort lines of text

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

what does uniq do?

A

Report or omit repeated lines

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

What does grep do

A

Print lines matching a pattern

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

what does wc do?

A

Print newline, word, and byte counts for each file

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

what does head do?

A

Output the first part of a file

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

what does tail do

A

Output the last part of a file

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

What does tee do?

A

Read from standard input and write to standard output and files

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

What are the two types of output?

A
  1. The program’s results (the data the program is designed to produce) 2. Status and error messages that tell us how the program is getting along.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is expressed as stdout?

A

standard output

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

What is expressed as stderr?

A

standard error

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

What are linked by default to the screen and not saved into a disk file?

A

Standard Error and Standard Output

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

What is expressed as stdin?

A

standard input

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

What is by default attached to the keyboard?

A

standard input

17
Q

What key is the redirection operator

A

>

18
Q

What will truncate an existing file or create a new, empty file?

A

Simply using the redirection operator with no command preceding it. i.e. > ls-output.txt

19
Q

What does the shell reference internally as file descriptors 0,1,2?

A

Standard input, output, and error, respectively

20
Q

What redirection must refer to its file descriptor?

A

Standard Error

21
Q

How do you dispose of unwanted output?

A

/dev/null

22
Q

What does conatenating files do?

A

the command reads one or more files and copies them to standard output.

23
Q

What happens if cat is not given any arguments?

A

It reads from standard output. (It’s waiting for you to type something)

24
Q

How do you tell cat it has reached EOF?

A

Ctrl-D

25
Q

What does EOF mean

A

End of File

26
Q

What does the shell feature called pipelines utilize?

A

Thee capability of commands to read data from standard input and send to standard output.

27
Q

What key is the pipe operator?

A

|

28
Q

what is piping?

A

The standard output of one command can be chained into the standard input of another

29
Q

What is the difference between the pipeline operator and the redirection operator?

A

the redirection operator connects a command with a file, while the pipeline operator connects the output of one command with the input of a second command.

30
Q

What command prints the first ten lines of a file?

A

Head

31
Q

What command prints the last ten lines of a file?

A

tail

32
Q

How do you adjust commands that print the first/last ten lines of text of a file?

A

-n