PrepAway - Latest Free Exam Questions & Answers

Which of the following commands can he use to accomplish this?

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. John is working
as a root user on the Linux operating system. He stores his passwords in the password.txt file. He stores them in such a
manner that in the password file, each word is separated with a delimiter colon (:) and the fifth word to the end of the line
becomes the password of the user. If there is any colon from the fifth word to the end of the line, the colon will be used as the
password. For example, a sample of a password.txt file is given below:

foo:bar:baz:qux:quuux
one:two:three:four:five:six:seven
alpha:beta:gamma:delta:epsilon:zeta:eta:teta

In the above example, the sample passwords will be as follows:
quuux #From the first line
five:six:seven #From the second line
epsilon:zeta:eta:teta #From the third line

John wants to store the passwords from the password.txt file and send them to the management of Perfect Solutions Inc. For
this, he has to fetch the passwords from the password.txt file and store them into the Password_management.txt file using a
Linux command. Which of the following commands can he use to accomplish this?

PrepAway - Latest Free Exam Questions & Answers

A.
cat password.txt > password_management.txt

B.
cut -d : -f 5- password.txt > password_management.txt

C.
cut -c 4-10 password.txt > password_management.txt

D.
sed -e ‘/^ *$/d’ password.txt > password_management.txt


Leave a Reply