vim Flashcards
Undo the most recent edit.
u
delete a single character
x
Copy line
y
Paste
p
Configure vim to show line numbers
echo 'set number' >> ~/.vimrc
Explain the PS1 variable
controls the appearance of the shell prompt
sets the locale encoding to french
LANG=fr_FR.UTF-8
List all input and output communication channels for processes
0: standard in
1: standard out
2: standard err
3: file
Diff between:
> output.log 2>&1
and
2>&1 > output.log
First redirects stdout to output.log and stderr to the same location as stdout which is output.log
Second redirects stderr to default place for stdout which is console and then redirects std out to output.log
What is merging redirection operator
&> output.log
equivalent to:
> output.log 2>&1
redirect the output of the ls command to the output.log file and passes it to the less command
ls | tee output.log | less
Different vim modes
1) Command mode
2) Insert mode
3) Visual edit mode
4) Extended command mode
How do you access visual editor mode
while in command mode, type v
How do you access extended command mode
in command mode type colon (:)
Key commands in visual edit mode
1) Multiline selection Shift + v
2) Block selection Ctrl + v