Ch 4 Flashcards
(24 cards)
less
Opens the text file in a pager, which allows for easy reading
cat
dumps the contents of the text file on the screen
head
Shows the first ten lines of the text file
tail
shows the last ten lines of the text file
cut
used to filter specific columns or characters from a text file
sort
sorts the contents of a text file
wc
counts the number of lines, words and characters in a text file
^text
Matches line that starts with specified text
text$
Matches line that ends with specified text
*
wildcard
[abc]
matches a, b or c
?
Extended regular expression that matches zero or one of the preceding character
+
Extended regular expression that matches on or more of the preceding characters
*
matches zero to an infinite number of the previous character
{2}
matches exactly two of the previous character
colou?r
matches zero or one of the previous character
(…)
used to group multiple characters so that the regular expression can be applied to the group
grep -i
matches upper and lower case letters
grep -v
shows only lines that do not contain regular expressions
grep -r
seraches files in the current directory and all subdirectories
grep -e
searches for lines matching more than one regular expression. Use -e before each regular expression you want to use
grep -E
interprets the search pattern as an extended regular expression
grep -A <number></number>
shows <number> of lines after the matching regular expression</number>