Text Processing and Editing Flashcards

1
Q

How to exit Nano

A

Ctrl X

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

How to save in Nano

A

ctrl O

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

Get help in Nano

A

ctrl G

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

Open a second file within Nano

A

ctrl R then alt F (new buffer, otherwise it just inserts)

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

Swap between buffers in Nano

A

alt > or <

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

Create a new buffer (file) alongside one already open in Nano

A

ctrl R, alt F

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

Copy/cut a line in Nano

A

ctrl K (cuts) then ctrl U (pastes)

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

Mark a region in Nano

A

alt A, then move cursor

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

Copy a region in Nano

A

ctrl ^
(ctrl shift 6)

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

Find a word (string) in Nano

A

ctrl W.

Is not case sensitive
alt W will continue to search

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

How to find a replace all instances of a string in Nano?

A

ctrl\ or alt R

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

How to enter insert mode in Vim

A

i

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

How to enter command mode in Vim

A

:

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

How to enter visual mode in Vim

A

It opens into visual mode, otherwise hit Esc

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

How to delete a line in Vim

A

: d
Or Esc -d-d

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

How to save then quit Vim

17
Q

How to quit without saving in Vim

18
Q

How to bring up line numbers in Vim

A

:set number

19
Q

How select a range of lines in Vim

20
Q

Copy in Vim

A

Y (in command)
yy (in visual)

21
Q

Paste in Vim

22
Q

Find a string in Vim

A

/STRING (case sensitive)

23
Q

Jump to a string instance in vim as you open

A

vim +/STRING FILE

24
Q

How to repeat a search in Vim

A

/ ENTER
or from visual mode
‘n’ (forwards) N (backwards)

25
How to search AND replace in Vim
:s/STRING/REPLACEMENT
26
How to search and replace over a range of lines in Vim
:1,1000s/STRING/REPLACEMENT
27
Reload original file in Vim e.g to undo
:e!
28
Common “pr “ options
-n Display in n columns -l n Change default 66 line page to n -m Merge multi files in parallel column -s c Change default separator to c -t Omit head and tails -w n change default 72 width to n
29
Common “cat” options
-A show all (inc non printing char) -E Display $ for new line feed -n Number lines -s Squeeze (no display) blank lines -T Show tabs (with ^I) -v Show non printing (^ or M-)
30
What is file globbing?
When wildcards are added to a filename argument, so the name can be expanded into multiple names
31
How do you repress file globbing in “locate”
“\STRING”
32
Common “locate” options
-A Files that match all patterns -b just match in the name, not in dir -c display number of matches -i ignore case -q quiet, don’t show errors -r use regex -w defaults and is anything in name or dir that matches
33
syntax for “getent”
getent FILE USER