Write a grep (or grep) command that selects the lines from
a file that have exactly three characters.

Answers were Sorted based on User's Feedback



Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / ripu

grep ^...$ <filename>

Is This Answer Correct ?    61 Yes 8 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / leo

grep ^...$ <filename>

Is This Answer Correct ?    24 Yes 3 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / manoj kumar kar

grep ^...$ <filename>

Is This Answer Correct ?    12 Yes 4 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / usama el far

grep -n root /etc/passwd|cut -f1 -d:

Is This Answer Correct ?    5 Yes 1 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / ramesh

grep "^...$" <file name>

Is This Answer Correct ?    4 Yes 1 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / khushi

grep '\<...\>' filename

Is This Answer Correct ?    4 Yes 1 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / rajasekar utl

grep ^...$ <filename>

Is This Answer Correct ?    4 Yes 2 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / saravan

grep -w [a-zA-Z][a-zA-Z][a-zA-Z] <filename>

Is This Answer Correct ?    4 Yes 3 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / satyawan

grep -n '\w{3}' <filename>

Is This Answer Correct ?    2 Yes 1 No

Write a grep (or grep) command that selects the lines from a file that have exactly three characte..

Answer / chintalapudi

grep -x '^???$' <filename>

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Unix Commands Interview Questions

what are the differences between CUI and GUI interfaces?

52 Answers   College School Exams Tests, HCL, HP, IBM, IBMR, NIIT, Talco, Wipro,


Why is grep called grep?

0 Answers  


what is the use of uniq commmand?

8 Answers  


Hi All, Can you please let me know how to grep for a particular pattern in unix. I want to print the dates from the file exp.txt. the date pattern is DD:MM:YYYY, I just want to print all the dates from the file exp.txt.

8 Answers   Concentrix, IBM, Symantec, TCS,


How do you find which version and name of unix you are using at the command prompt?

7 Answers  






How to check whether some services are running in another server or not? Suppose i am currently in a server named A.I want to check whether some services are running in server B without logging into the server B.

3 Answers   Amazon, MBA, Syntel, TCS, Unisys,


what is mount ,tell me about mount ,how can u use in real time project??

12 Answers   Symphony,


Briefly, how do you install Oracle software on UNIX.

2 Answers  


How to view the hidden files in /etc directory?

10 Answers  


what are processor execution levels and priorities?

2 Answers   Infosys,


in a growing log file how will you see the 1st 99 lines?

7 Answers  


Who wrote grep?

0 Answers  


Categories