Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 Match the sed command with the correct output. All of the text is a single line in the sed commands. - A. B.

QUESTION 1

Match the sed command with the correct output. All of the text is a single line in the sed commands.

- A. B. C. D. E. F.

sed -e '1,2d' -e 's/\(.*\):\(.*\):\(.*\):\(.*\):\(.*\):\(.*\):\(.*\)/\1:\5:\6:\7/'

- A. B. C. D. E. F.

sed -sed -e '1,2d' $1e 's/\(.*\):\(.*\):\(.*\):\(.*\):\(.*\):\(.*\):\(.*\)/\1:\5:\6:\7/'

- A. B. C. D. E. F.

sed -e '1,2d'

- A. B. C. D. E. F.

sed -n -e '/^s/p'

- A. B. C. D. E. F.

sed -e 's/^\(.*\),\(.*\),\(.*\)$/\3,\2,\1,&/'

- A. B. C. D. E. F.

sed -e 's/.*$/& &/'

A.

grep '^s'

B.

Deletes lines 1 and 2

C.

Deletes lines 1 and 2 and for the rest of the lines print fields 1,5,6,7 from a colon separated list

D.

Produces a syntax error with sed

E.

take the original line and repeat it 2 times

F.

swap column 1 and 3 of a comma separated list and put the original list at the end

50 points

QUESTION 2

Match the command to the statement that best describes it.

- A. B. C. D. E. F. G.

cut -d: -f7 | sort -u < /etc/passwd

- A. B. C. D. E. F. G.

cut -d: -f1 < /etc/passwd

- A. B. C. D. E. F. G.

cut -d: -f7 /etc/passwd | sort -u

- A. B. C. D. E. F. G.

ls | paste - - - -

- A. B. C. D. E. F. G.

cut -d: -f1,5 /etc/passwd

- A. B. C. D. E. F. G.

vi `grep -l foobar *.c`

- A. B. C. D. E. F. G.

grep -v '^mr' /etc/passwd

A.

The command will print the passwd file sorted and then wail for input from standard input.

B.

Print fields 1 and 5 from the password file (separated by a :)

C.

Edit all the files .c whose contents contain the text foobar

D.

Take the output of ls and put it on standard output 4 per line

E.

print all lines in the password file which don't begin with ^mr

F.

Print field 1 of the passwd file.

G.

The command to cut field 7 of the password file and then sort the results removing any redunant

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago