Final (Unix 2) Flashcards
What are process priorities?
Relative importance or priority assigned to processes by the operating system’s scheduler. The scheduler is responsible for determining which processes get CPU time and in what order.
What is a shell script?
A file which contains a set of predefined shell commands and/or operations written in a scripting language (such as Bash) which is interpreted by the shell.
What is egrep?
Extended grep. It allows (), +, -, ?, |, and other operators that normally don’t work with grep.
grep -E option can also generally produce this behavior.
What do the -i, -w, -c, -v, -l, and -E options do in a grep command?
-i: ignores case
-c: causes the number of lines matched to be printed
-w: forces search to look for entire words
-v: causes lines that -don’t- match to be output
-l will return only the name of the file(s) if grep finds a match
-E allows use of (), +, -, I, ? and other operators that normally don’t work with grep
What is the syntax of grep?
grep <options> <pattern> <files></files></pattern></options>
What would the command:
grep crap MyFile.txt
do?
Search the file MyFile.txt for any instance of the character sequence crap in the text and return them.
What would the command:
grep ^This MyFile.txt
do?
Look for line starting with “This” in MyFile.txt
What would the command:
grep receive *.sh
do?
Look for “receive” in any file ending in .sh
What would the command:
grep “[abc].*” MyFile.txt
do?
Find a substring with an a, b, or c, followed by any number of other characters.
What would the command:
grep “ii*” MyFile.txt
do?
It would check MyFile.txt for any line that has one or more i characters in it, including multiple i characters in a row.