1-2 Use Input-output Redirection (>,>>,|,2,etc...) Flashcards

1
Q

Redirect output into a file,

Not include error messages

A

cat FileName1 > FileName2

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

Redirect error messages into a file,

Not include output

A

cat FileName1 2> FileName2

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

Redirect output AND error messages into a file

A

cat FileName1 &> FileName2

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

cat FileName1 > FileName2

A

Redirect output into a file,

Not include error messages

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

cat FileName1 2> FileName2

A

Redirect error messages into a file,

Not include output

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

cat FileName1 &> FileName2

cat FileName1 > FileName2 2>&1

A

Redirect output AND error messages into a file

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

cat NoFileName FileName 2>&1 | grep “No such file”

A

Redirect error messages into stdout,

Which allows error (AND output) both to be piped

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

mysql TableName < FileName

A

Input redirection into commands that accept input

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

cat largefilename > /dev/null

cat NoFileName LargeFileName &> /dev/null

A

Redirect output into deletion

Redirect output AND error into deletion

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

head FileName

A

Display first ten lines of file

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

tail FileName

A

Display last ten lines of file

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

head -n 5 FileName

A

Display first 5 lines of file

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

tail -n 5 FileName

A

Display last five lines of file

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

less FileName

ENTER key to scroll down by line

SPACE key to scroll down by page

b key to scroll back by page

A

Display only one page(screen) at a time of file

Access is faster because whole file is NOT accessed(processed)

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

more FileName

ENTER key to scroll down by line

SPACE key to scroll down by page

b key to scroll back by page

A

Display only one page(screen) at a time of file

Access is NOT faster because whole file is accessed(processed)

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