Final (Unix 2) Flashcards

1
Q

What are process priorities?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a shell script?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is egrep?

A

Extended grep. It allows (), +, -, ?, |, and other operators that normally don’t work with grep.

grep -E option can also generally produce this behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do the -i, -w, -c, -v, -l, and -E options do in a grep command?

A

-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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the syntax of grep?

A

grep <options> <pattern> <files></files></pattern></options>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What would the command:

grep crap MyFile.txt

do?

A

Search the file MyFile.txt for any instance of the character sequence crap in the text and return them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What would the command:

grep ^This MyFile.txt

do?

A

Look for line starting with “This” in MyFile.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What would the command:

grep receive *.sh

do?

A

Look for “receive” in any file ending in .sh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What would the command:

grep “[abc].*” MyFile.txt

do?

A

Find a substring with an a, b, or c, followed by any number of other characters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What would the command:

grep “ii*” MyFile.txt

do?

A

It would check MyFile.txt for any line that has one or more i characters in it, including multiple i characters in a row.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly