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

write a shell script to find the largest number from 3 given numbers.

6 Answers  


What is the difference between break and continue commands?

0 Answers  


How do I run a bin bash script?

0 Answers  


What is sed in shell script?

0 Answers  


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

4 Answers  


what is the difference between sh & bash shell?

1 Answers  


Is shell scripting a language?

0 Answers  


1.Write a script, which converts a number from binary to hexadecimal format or vice versa.

1 Answers   ADP,


What is the first line in every perl script called?

0 Answers  


How to print all the arguments provided to the script?

0 Answers  


What is path in shell script?

0 Answers  


How will I insert a line "abcdef" at every 100th line of a file?

2 Answers  


Categories