Lesson 3 Flashcards
>
Redirects standard output of a command to a file, overwriting the previous content
> >
Redirects standard output of a command to a file, appending the new content to the previous content
Redirects standard input to command
|
Redirects standard output of a command to another command
wc
Gives word count (lines, words and characters)
sort
Sorts lines of text alphabetically
uniq
Filters duplicate, adjacent lines of text
grep
Searches text for a pattern and outputs it
sed
Searches text for pattern, modifies it, and outputs it
sed ‘s/originalWord/replacementWord/’ file.txt (s = substitute. Only substitutes first instance in a line)
sed ‘s/originalWord/replacementWord/g’ file.txt (g = global. Substitutes all instances)