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

Sorry to all Technical person for mistake of Question. Now i am post currect question Why copied file permission is changed in destination. When i give all permission i.e 777 to file and copy that to other location in destination the permission is 755. But if give permission 555 in destination that file permission is 555 and if give permission 444 to file after copy in destination the file permission is 444. These all are happening in normal user. How the umask value is calculate here really i am not understand. Please write the proper answer. Thanks in Advance

3 Answers   TCS,


The command grep first second third /usr/you/myfile a) prints lines containing the words first, second or third from the file /usr/you/myfile b) searches for lines containing the pattern first in the files second, third, and /usr/you/myfile and prints them c) searches the files /usr/you/myfiel and third for lines containing the words first or second and prints them d) replaces the word first with the word second in the files third and /usr/you/myfile e) None of the above

4 Answers   IBM,


What do know about tee command and its usage?

0 Answers  


Name the general commands in using unix os for a beginner?

0 Answers  


what are processor execution levels and priorities?

2 Answers   Infosys,






What Command will remove a Directory in UNIX?

8 Answers   IBM,


How do you stop a running process?

7 Answers  


What does find command return in unix?

0 Answers  


What is an Unix command to convert HEX value to ASCII value located in any flat file.

2 Answers  


What is the difference between Shell Programming and Shell scripting?

10 Answers   HCL, TCS, Wipro,


What do chmod, chown, chgrp commands do?

0 Answers  


What are the general commands in using unix os for a beginner?

0 Answers  


Categories