how to find the 51th record of a file containing 100 records
in unix.

Answers were Sorted based on User's Feedback



how to find the 51th record of a file containing 100 records in unix...

Answer / ruchi agarwal

head -n 51 filename |tail -1

Is This Answer Correct ?    45 Yes 4 No

how to find the 51th record of a file containing 100 records in unix...

Answer / sundar octavious

head -51 <filename> |tail -1

The above command will display the answer.

Is This Answer Correct ?    33 Yes 1 No

how to find the 51th record of a file containing 100 records in unix...

Answer / harsha

sed -n 51p <filename>

Is This Answer Correct ?    19 Yes 1 No

how to find the 51th record of a file containing 100 records in unix...

Answer / biswa

cat <filename>|head -51|tail -1

Is This Answer Correct ?    8 Yes 1 No

how to find the 51th record of a file containing 100 records in unix...

Answer / deepak

head -51 <filename> | tail -1

Is This Answer Correct ?    2 Yes 0 No

how to find the 51th record of a file containing 100 records in unix...

Answer / dinesh babu

awk '{if (NR==51) print$0}' filename

Is This Answer Correct ?    0 Yes 0 No

how to find the 51th record of a file containing 100 records in unix...

Answer / abani_mahana

head -51 | tail -1

Is This Answer Correct ?    0 Yes 0 No

how to find the 51th record of a file containing 100 records in unix...

Answer / raj

sed '51p' filename

Is This Answer Correct ?    0 Yes 1 No

how to find the 51th record of a file containing 100 records in unix...

Answer / dinesh kumar

awk 'NR=51 Printf{$0}' filename

Is This Answer Correct ?    0 Yes 2 No

how to find the 51th record of a file containing 100 records in unix...

Answer / supriya

head -51|tail -1 <filename>

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More Unix Commands Interview Questions

Through which command will redirect output to bOth screen and files at the same time?

3 Answers  


what are the uses of filters?

3 Answers  


How does the user view the contents of a text file in UNIX?

9 Answers   IBM,


Where LOG fiels resides in AIX and pls tel me how to remove the log file

6 Answers   Vestas,


what are the different commands used to view the contents of a file?

5 Answers  


Explain ‘library functions’ with respect to unix commands?

0 Answers  


How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazement in some of the line.But i want to replace only 'amaze' with delight but don't wanna replace amazed or amazement. thanks

6 Answers   Polaris, Tech Mahindra,


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

5 Answers   Cosmic Infotech, Perot Systems,


Which command is used to kill the last background job?

0 Answers  


what is the default permission for /etc/shadow file in UNIX

2 Answers   Wipro,


what is the command to find out which shell you are running?

14 Answers  


what is the use of uniq commmand?

8 Answers  


Categories