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 / manu

if you want 1 to 7 row then
head -7 filename
if you want only 7th row exactly then
head -7 filename|tail -1
or
tail +7 filename|head -1
or
cat -n filename|grep '^7' filename

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is grep and how do you use it?

581


What is the command to find hidden files in the current directory?

589


How does pipe () work?

599


What is $0 bash?

653


What does the command '$ls | wc –l > file1' do?

684






Is grep faster than awk?

568


How to find $ai_serual resolved path by using unix

1031


What is the pipe command?

584


Which command can you use to find the currently running process in unix server?

592


Why is awk called awk?

581


Write a command to display a file’s contents in various formats?

631


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

628


How do I search a whole word in vim?

697


What are the differences among a system call, a library function, and a unix command?

571


What is grep in bash?

591