if we create a file, in that 10 rows(means 1,2,....9,10
like). i want 7 row exactly, which command use in unix?
plz send this question.

Answer Posted / meenu

if u want first 7 rows then
head -n7 <filename>
but if you want only 7th row then
awk 'nr==7 {print}' <fileanme>
or
tail -n4 <filename>|head -n1

Is This Answer Correct ?    0 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the search command in unix?

818


Explain how to use grep command to list find the records of a file containing 10 different strings?

804


Is command prompt unix?

790


How many unix commands are there?

819


How do I use grep to search for a file?

789


What is the use of tee command?

766


What is command statement?

792


What do chmod, chown, chgrp commands do?

897


What is the use of the command 'ls -x chapter[1-5]' ?

895


What is ctrl d?

809


Which unix command to make a new directory?

800


Explain ‘library functions’ with respect to unix commands?

819


Differentiate cmp command from diff command.

802


Write a command to kill the last background job?

793


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

814