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

Why is a script important?

0 Answers  


Is bash a shell script?

0 Answers  


What is bash shell command?

0 Answers  


What is the use of "test" command?

2 Answers  


How do I run a shell script in powershell?

0 Answers  






The information of the two files should be redirect to Third file in such a way that, the third file contain the information like this. 1st line in third file should be from 1st file 2nd line in Third file should be from 2nd file 3rd line in Third file should be from 1st file 4th line in Third file should be from 2nd file - - so on

2 Answers   Caritor,


How important is shell scripting?

0 Answers  


How to customise the existing shell?

1 Answers  


Explain about echo command?

0 Answers  


How to group the commands in shell scripting?

2 Answers   Polaris,


Where is bash history?

0 Answers  


What are the different shells available?

3 Answers  


Categories