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

What is time_t?

0 Answers  


How to find $ai_serual resolved path by using unix

0 Answers  


how unix kernel distinguishes between a normal file and device file ?

7 Answers   Google, IBM, McAfee, Vodafone,


What is the use of cut command in unix?

0 Answers  


How do you grep a case insensitive?

0 Answers  


What is the use of pipes?

4 Answers  


Where can I get the free download of Unix by Yeswant Kanetkar?

5 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,


what is the use of ls -l command & what is the information it gives about user ?

5 Answers  


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

7 Answers   IBM,


How to get the operating system's information in unix?

6 Answers   IBM, TCS,


Give Command that will change the name of a directly from paypal to eBay

3 Answers   Alcatel, IBM,


Categories