Edit text files, use filters, use regular expressions - Ch3 Flashcards

1
Q

cat

A

Command used to…
create and view files;
concatenate two or more files into one

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

vi

A

Command to start vi editor

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

How does one exit vi

A

Esc key

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

How is text inserted using vi

A

i to insert before the cursor position

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

How is text inserted at the beginning of a line while using vi?

A

l

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

How is text appended after the current cursor position using vi?

A

a

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

How is text appended at the end of the current line using vi?

A

A

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

How is a new line opened below the current line using vi?

A

o

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

How is a new line opened above the current line using vi?

A

O

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

How are changes saved to a text file without exiting vi?

A

:w

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

How are changes saved to a text file and vi exited?

A

:wq or :x or ZZ

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

How is vi exited without saving changes to text file?

A

:q!

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

cut

A

Used to filter, extract and display selected output

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

fmt

A

Text formatting command used to set col width, add uniform spacing, add indentation, …

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

od

A

Octal dumping: allows viewing file in mult formata

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

join

A

Filter used to join each corresponding line from two files if join fields are identical

17
Q

paste

A

Filter used to display lines consisting of sequentially corresponding lines from one or more specified files

18
Q

sed

A

Stream editor used for filtering text and transforming output display as desired

19
Q

sort

A

Command used to arrange columns of text in a specified order for default screen display or alternately redirected to a file

20
Q

grep

A

Searches contents of one or more text files and displays matched information

21
Q

What are the 3 vi modes?

A

Command;
Edit;
Last line

22
Q

pr

A

Filter used to format text files for printing;
Output includes a header with file name, date & time, …
Includes a footer