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

To display first 7 lines of file:-

1) head -7 filename

2) cat filename|head -7



To display only 7th line of file:-

1) head -7 filename|tail -1

2) cat filename|head -7|tail -1

3) tail +7 filename|head -1

choice is ur's..Which one u feel looks gud...:):):)

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 s and g in sed command?

567


What are reported commands?

576


What are the general commands in using unix os for a beginner?

585


What does grep v do?

568


What are the unix commands?

567






What is the behavioural difference between cmp and diff commands?

690


What is the size of time_t?

671


Write a command that will display files in the current directory, in a colored, long format.

695


Are you in or at the office?

626


What does pipe () return?

604


How can we use grep command in unix?

623


What are some command words?

573


What are bash commands?

606


What is .sh file?

626


What is the pipe command?

590