Test 2 Flashcards
Explain what a file descriptor does in Linux?
File descriptors are data channels, they read input for the keyboard standard input(channel 0), send normal output to the terminal standard output(channel 1), and sends error messages to the terminal standard error (channel 2)
Stdin
standard input, from a keyboard
Stdout
standard output whatever processes
Redirection
output and error cant be captured as file contents, sent to a device, or discarded
Pipeline
a sequence of one or more commands separated by |
Stderr
standard error where all the errors go
Pipe
connects the standard output of the first command to the standard input of the next command
tee
pipe and redirect at the same time
> file
redirect stdout to overwrite a file
> > file
redirect stdout to append a file
> file 2> file2
redirect stdout to overwrite file2
2> /dev/null
discard stderr error messages by redirecting to /dev/null
&> file
redirect stdout and stderr to overwrite the same file
&» file
redirect stdout and stderr to append to the same file
What is vim?
Improved version of the vi editor, vim is highly configurable and efficient for practiced users
Define the three modes of vim?
Edit, command, visual edit
What is the default mode in vim?
Command mode
What is the keystroke to enter insert mode?
i
What is the keystroke to go from insert mode to command mode?
esc
What is the keystroke to enter visual mode for a block of text?
v