How would you print just the 25th line in a file using
smallest shell script?

Answers were Sorted based on User's Feedback



How would you print just the 25th line in a file using smallest shell script?..

Answer / guest

head -25 filename | tail -1

Is This Answer Correct ?    14 Yes 2 No

How would you print just the 25th line in a file using smallest shell script?..

Answer / swaroopa

sed -n 25p <filename>

Is This Answer Correct ?    11 Yes 0 No

How would you print just the 25th line in a file using smallest shell script?..

Answer / alok

awk -F"|" ' NR == 25 {print} ' emp.lst

in this file | is a field seprator

Is This Answer Correct ?    0 Yes 4 No

How would you print just the 25th line in a file using smallest shell script?..

Answer / santana20142003

$ls -lrt | awk 'NR==2'

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More Shell Script Interview Questions

What are the advantages of bash over all other shells?

1 Answers  


What is shift command in shell script?

0 Answers  


What does it mean to debug a script?

0 Answers  


What is bash eval?

0 Answers  


What is the first line in a shell script?

0 Answers  






What are the default permissions of a file when it is created?

0 Answers  


What is ms powershell?

0 Answers  


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

0 Answers  


What is a shell environment?

0 Answers  


What is the significance of the shebang line in shell scripting?

0 Answers  


c program to check whether all the directories in the path exists has read and write permission

1 Answers  


How do I edit a .sh file?

0 Answers  


Categories