1/58
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
what does cut do?
cuts data from a file or piped stdout
what does the paste command do?
puts two lines together
how do you set the delimiter in the paste command?
using the -d option
how is output of cut redirected?
> or |
cut -c only works for fixed length fields (t/f)
true
how can you specify the field number with the cut command?
-f
text and file contents do not need filtering/reformatting before being used (t/f)
false
what are some reformatting/filtering commands
head
tail
grep
tr
sort
uniq
head is a derivative of which basic command?
cat
what does head do?
prints out first n lines of a file to stdout
what is the default value of n in head?
10
what is the syntax of head?
head -n # filename1
ex: head -n /etc/resolv.conf
what is tail a derivative of?
cat
tail is the opposite of what command?
head
what does the head command do?
print out the last n lines of a file to stdout
what is the default value of n in tail?
10
what is the syntax of tail?
tail -n # filename
ex: tail -n /var/log
the tail command supports piping (t/f)
false
what does grep stand for?
globally regular expression print
what does grep do?
sends lines with a regex search term to stdout
what does the tr command mean?
transliterate
what does the tr command do?
translates characters in a standard input stream
how are characters translated in tr command?
with a pipe or < (read input from file)
tr can use regular expressions as parameters (t/f)
true
tr can use octal values of ASCII chars for paramters (t/f)
true
what does the -s option do in the tr command?
replace repeated characters
what does the -d option do in the tr command?
delete charaters
tr cannot use character classes as parameters (t/f)
false
character classes can be thought of as regular expressions (t/f)
true
what are some common character classes?
alpha
lower
upper
digit
alnum
cntrl
punct
what does the sort command do?
reorderrs lines in alphabetical order
does uppercase or lowercase come first in the output of a sort command?
uppercase
what does the -u option do for the sort command?
removes all duplicate entires in the output
what does the -n option do for the sort command?
sorts a numeric list
what does the -r option do for the sort command?
sorts the list in reverse order
what does uniq command do?
removes consecutive repeated lines
uniq can provide a count of unique words (t/f)
true
what are the two methods for string processing?
expr
${
expr is an external command (t/f)
false, it is internal
${
true
what will return the length of the string?
${#
what will return the number of elements in an array?
${#VAR[@] }
what will return the remaining substring of a string as a specific position?
${
what will return teh substring of string length at a specific position?
${
what does ${
returns the SHORTEST match of substring from the FRONT of string
what does ${
returns the LONGEST match of substring from the FRONT of string
what does ${
returns SHORTEST match of substring form the BACK of string
what does ${
returns the LONGEST match of substring from the BACK of string
what does ${
returns string with the FIRST match of substring replaced by replacement
what does ${
return string with ALL matches of substring replaced by replacement
what does ${
if substring matches the FRONT of string, return string with substring replaced by replacement
what does ${
if substring matches the BACK of string, return string with substring replaced by replacement
what does expr match
returns the length of the matching
what does expr index
returns position in string of the first char of matching substring
what does expr substr
returns length characters from string starting at position
bash supports regex comparison (match) operator =~ in what type of test?
double bracket [ [ ] ]
when using BASH built in REGEX functions, you can extract strings with () (t/f)
true
BASH_REMATCH is an arry (t/f)
true
what happens if BASH_REMATCH has no index?
reuslt of all matches put together