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

How to create hardlinks and softlinks on files?

2 Answers  


Which unix command to make a new directory?

0 Answers  


What is file system in unix??

10 Answers   Symphony,


what are the different operating systems available?

3 Answers  


what is the advaantage of each user having its own copy of the shell?

0 Answers   BMC, CNS, DELL, Infosys,






What does mkdir up2date; touch outdated up2date do?

2 Answers  


What is grep and sed command?

1 Answers  


How do you list the files in an UNIX directory while also showing hidden files?

6 Answers  


What UNIX command will control the default file permissions when files are created?

4 Answers  


What is FIND, GREP and SED ? Could you please give me the difference between all the three? Where we use this commnands?

6 Answers   Deloitte, Polaris,


Name the various commands that are used for the user information in unix.

0 Answers  


What are bash commands?

0 Answers  


Categories