6 - I/O redirection Flashcards
stdout
*file linked to the screen to which output is sent to
stderr
*file linked to the screen to which status messages and errors are sent to
stdin
*file attached to the keyboard which accepts inputs
>
redirects stdout
*always rewrites from the beginning
> >
appends stdout instead of rewriting an entire file (for example)
file descriptors
numbers used by the shell to reference stdin/out/err (0,1,2)
redirecting stdout/err
&>
2>&1 *used after redirecting stdout
appending stdout/err
&»
/dev/null
a file, system device, bit bucket
*accepts input and does nothing with it
cat
copies stdin to stdout
*takes input from stdin on its own
<
redirects stdin
pipe operator
’|’
redirects stdout to the stdin of another command
sort
a “filter”
*alphabetizes a list of data
uniq
removes adjacent duplicates from a file
wc
*word count
*displays the lines, word count, and byte size contained in files