3.3 Sticking to the Script Flashcards

1
Q

Multiple text processing commands are already built into the terminal, such as?

A

cut

awk

sed

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

Using text manipulation commands within bash is preferable to using other programming languages for the following reasons:

A

Simplicity - Text processing is simpler and easier to learn than programming languages.

Convenience - Text processing is simpler and easier to learn than programming languages.

Compatibility - Text processing commands can easily be
added together to complete more advanced tasks—a complicated task with programming languages.

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

sed stands for __________?

A

stream editor

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

True or False?

sed command reads and edits text, line-by-line from an input stream. It is similar to the familiar find and replace feature in Windows systems.

A

True

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

Syntax for sed is:

sed s/(_______)/(___________)/

A

sed s/(old value)/(replacement value)/

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

Text Processing Commands manipulate text and simplify complex data by (3):

A
  1. Substituting
  2. Filtering lines of text
  3. Delimiting text
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

You need to replace the string ACCESS_ACCEPTED with LOGGED_IN to make the data consistent and allow for both datasets to be analyzed together. What command do you use?

A

sed

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

The most basic sed capability is __________.

A

The most basic sed capability is string replacement.

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

sed is a text processing utility that can help security professionals __________.

A

sed is a text processing utility that can help security professionals analyze data.

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

AWK Operations:

a) __________________
b) __________________
c) __________________
d) __________________

A

a) Scans a file line by line
b) Splits each input line into fields
c) Compares input line/fields to pattern
d) Performs action(s) on matched lines

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

AWK command is useful for:

a) __________________
b) __________________

A

a) Transform data files

b) Produce formatted reports

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

Explain the awk command

A

Awk is a scripting language used for manipulating data and generating reports.

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

The basic syntax of field separation with awk is:

awk -F (_______) ‘{print $(________r)}’

A

awk -F(delimiter) ‘{print $(field_number)}’

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

Shell is a terminal program that assists in the interaction between _______ and ________.

A

Shell is a terminal program that assists in the interaction between user and the terminal.

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

When a script is run, you can add an argument by placing it _______ the script name.

A

When a script is run, you can add an argument by placing it after the script name.

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