What output will be displayed on the screen when the following command is executed:

The file myfile.txt contains the following data:

joe:x:100:100:Joe:/home/joe:/bin/bash
mike:x:101:101:Mike:/home/mike:/bin/sh
kevin:x:102:102:Kevin:/home/kevin:/bin/sh
matt:x:103:103:Matt:/home/matt:/bin/sh

What output will be displayed on the screen when the following command is executed: grep o home myfile.txt

The file myfile.txt contains the following data:

joe:x:100:100:Joe:/home/joe:/bin/bash
mike:x:101:101:Mike:/home/mike:/bin/sh
kevin:x:102:102:Kevin:/home/kevin:/bin/sh
matt:x:103:103:Matt:/home/matt:/bin/sh

What output will be displayed on the screen when the following command is executed: grep -o home myfile.txt

A.
No output will be displayed on the screen

B.
home home home home

C.
/home/joe /home/mike /home/Kevin /home/matt

D.
joe mike Kevin matt



Leave a Reply 2

Your email address will not be published. Required fields are marked *


sara

sara

Please add – before o , like grep -o home myfile .
Without “-” line above give error . Options should be with – and , — if you want to type full name of option . For example -a and –all . Use which is more easy for you.
Thanks.

admin

admin

Thanks sara so much.
I fixed it.