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

Is bash an operating system?

1 Answers  


What are the advantages of using shell scripts?

1 Answers  


how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com

1 Answers  


What is the crontab?

1 Answers  


What is sudo command?

1 Answers  


How to take input values from the user?

4 Answers  


What is the command to find out users on the system?

1 Answers  


write a scwipt that a) takes exactly one argument, a directory name. b) if the number of argument is more or less than one,print a usage message c) if the argument is not adirectory, print another message d) for the given directory, print the five biggest files and the five files that were most recently modified. e) save the output to a file called q2output.

2 Answers  


What are environment variables?

2 Answers  


Is shell and terminal the same?

1 Answers  


Is cmd a shell?

1 Answers  


What is an inode block?

1 Answers  


Categories