Memory Tables Flashcards

1
Q

> 1>

A

Redirects STDOUT. If redirection is to a file, the current contents of that file are overwritten.

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

> > 1»

A

Redirects STDOUT in append mode. If output is written to a file, the output is appended to that file.

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

2>

A

Redirects STDERR.

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

2>&1

A

Redirects STDERR to the same destination as STDOUT. Notice that this has to be used in combination with normal output redirection, as in:

    ls whuhiu > errout 2>&1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

<
0<

A

Redirects STDIN.

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

Esc

A

In vim, switches from input mode to command mode. Press this key before typing any command.

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

i, a

A

In vim, switches from command mode to input mode at (i) or after (a) the current cursor position.

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

o

A

In vim, opens a new line below the current cursor position and goes to input mode.

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

:wq

A

In vim, writes the current file and quits.

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

:q!

A

In vim, quits the file without applying any changes. The ! forces the command to do its work. Add the ! only if you really know what you are doing.

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

:w filename

A

In vim, writes the current file with a new filename.

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

dd

A

In vim, deletes the current line.

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

yy

A

In vim, copies the current line.

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

p

A

In vim, pastes the contents that have been cut or copied into memory.

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

v

A

In vim, enters visual mode, which allows you to select a block of text using the arrow keys. Use d to cut the selection or y to copy it.

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

u

A

In vim, undoes the last command. Repeat as often as necessary.

17
Q

Ctrl-r

A

In vim, redoes the last undo. (Cannot be repeated more than once.)

18
Q

gg

A

In vim, goes to the first line in the document.

19
Q

G

A

In vim, goes to the last line in the document.

20
Q

/text

A

In vim, searches for text from the current cursor position forward.

21
Q

?text

A

In vim, searches for text from the current cursor position backward.

22
Q
A

In vim, goes to the first position in the current line.

23
Q

$

A

In vim, goes to the last position in the current line.

24
Q

!ls

A

In vim, adds the output of ls (or any other command) in the current file.

25
Q

:%s/old/new/g

A

In vim, this would replace all occurrences of old with new.