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 / suvarna

grep -w "[a-z][a-z][a-z]" file_name

Is This Answer Correct ?    0 Yes 0 No

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

Answer / vawani

grep -x ^...$ <File Name>

Is This Answer Correct ?    0 Yes 0 No

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

Answer / mahfooz

grep [a-z][a-z][a-z] filename

Is This Answer Correct ?    2 Yes 3 No

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

Answer / saravan

Sorry use the below commands to get the exact word contains
3 char in the file.

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

Is This Answer Correct ?    1 Yes 2 No

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

Answer / jyoti pruthi

grep -n "..." <filename>

It will give u the lines that have only 3 characters with
line numbers. Here, "..." replace any 3 characters (single
dot represent single character).

Is This Answer Correct ?    0 Yes 1 No

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

Answer / niranjan

1)grep ??? filename

2)grep ^...$ filename

Is This Answer Correct ?    0 Yes 1 No

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

Answer / manideep

grep "..." <filename>

Is This Answer Correct ?    6 Yes 8 No

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

Answer / udhaya

grep ^???$ <filename>

Is This Answer Correct ?    2 Yes 5 No

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

Answer / rahul

grep -nw <charvalue> <filename>

Is This Answer Correct ?    1 Yes 7 No

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

Answer / chakri

grep -a filename

Is This Answer Correct ?    2 Yes 8 No

Post New Answer

More Unix Commands Interview Questions

Give Command that will move a single file called "unix.txt"

7 Answers   IBM,


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

7 Answers  


what is the difference between Touch & cat command

21 Answers   QA,


A file has 1000 lines and i want to display only 1st line how to do it? pls ..tel me

7 Answers   CTS,


what is the command to print last 8 lines of any text file.

10 Answers  






Give two UNIX kernel parameters that effect an Oracle install

3 Answers   Oracle,


what does the 'tee' command do?

4 Answers  


In Unix file permissions what does the second field denotes?

3 Answers  


Explain ‘library functions’ with respect to unix commands?

0 Answers  


what is the meaning of this command rm -rf / what will it do ?

5 Answers   Altair,


how will you login one server's shell prompt to an another server?

5 Answers   Cosmic Infotech, Perot Systems,


What are the unix commands?

0 Answers  


Categories