A file has 1000 lines and i want to display only 1st line
how to do it?
pls ..tel me

Answer Posted / radhakant kumar

awk '{if(NR==1) print $0}' filename

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

692


Differentiate cmp command from diff command.

677


What are file commands?

747


What is a command and examples?

677


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

781






Which unix command to make a new directory?

687


What is the difference between cat command and more command?

677


What is pipe command in unix?

786


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

760


Explain mount and unmount command.

717


Why is grep called grep?

875


Who wrote grep?

658


Is it inbetween or in between?

658


Are you in or at the office?

708


What is used to type command?

634