Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

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

1155


Which unix command lists files/folders in alphabetical order?

1659


What does the command ' $who | sort –logfile > newfile' do?

1238


What happens when we execute a unix command?

1088


What is command statement?

1103


What do chgrp command do?

1141


Why is awk called awk?

1019


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include # include int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

2201


hw will u use awk in replacing cahrs and files

3179


Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?

1335


What command is used to check the current users?

1063


Why is shebang used?

1042


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

1013


What is the unix command to confirm a remote host is alive or not?

1137


How does pipe () work?

1040