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

Answer Posted / raja

head -n <filename>

here n for no.of records we want.

ur quention my ans is
head -1 <filename>

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which command is used to delete all files in the current directory and all its sub-directories?

660


Which unix command to make a new directory?

587


Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

951


What is grep in bash?

584


hw will u use awk in replacing cahrs and files

2726






What does the “echo” command do?

624


how to sort the content of the file based on numeric values

1247


Describe the usage and functionality of the command rm –r * in unix?

820


What are the unix commands?

555


What is the function of grep command in unix?

584


What does touch command do in unix?

723


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

619


What are the commands in UNIX to list the files in a Directory?

614


Why is grep called grep?

774


Why is shebang used?

593