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...


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.

Answers were Sorted based on User's Feedback



if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / chinmaya sahu

tail +7 <filename> | head -1

Is This Answer Correct ?    0 Yes 1 No

if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / soumendra

ans- cut -d " " -f 1-7 <file name>

by this u can get all the 7 rows of ur file.
here i give 'space" as the delimeter.
u give the delimeter as u give in the file.

by -f option u can exactly get the 1 to 7 field/rows

Is This Answer Correct ?    0 Yes 1 No

if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / prasad

if we take 2 tables(like emp and dept), we use join stage and how to improve the performance?

Is This Answer Correct ?    0 Yes 2 No

if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / mo

Using VI editor this can be done like this.

type this command.

:1,7w <newfilename>

All Good
Mo

Is This Answer Correct ?    0 Yes 2 No

if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / amol tyagi

head -7 filename

Is This Answer Correct ?    1 Yes 6 No

if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / ashwini

sed -n 1,7p <filename>

Is This Answer Correct ?    2 Yes 8 No

if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / meenu

if u want first 7 rows then
head -n7 <filename>
but if you want only 7th row then
awk 'nr==7 {print}' <fileanme>
or
tail -n4 <filename>|head -n1

Is This Answer Correct ?    0 Yes 6 No

if we create a file, in that 10 rows(means 1,2,....9,10 like). i want 7 row exactly, which command..

Answer / guest

head -n 7 filename

Is This Answer Correct ?    4 Yes 12 No

Post New Answer

More Unix Commands Interview Questions

How to rename files and folders?

7 Answers   IBM, Oracle,


What does grep v grep do?

0 Answers  


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

0 Answers   Epsilon,


how to unzip the contents of the gzip file

1 Answers   Epsilon,


why unix commands can be divided into internal and external commands?

3 Answers   Informatica,


in a growing log file how will you see the 1st 99 lines?

7 Answers  


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<stdlib.h> # include <stdio.h> 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:

0 Answers  


What happens when we execute a unix command?

0 Answers  


Which command is used to create a directory?

0 Answers  


boot process?

2 Answers   Atos Origin, Wipro,


what is the shell for dos,nt operating systems?

1 Answers  


How to find the files that are accessed before 10 minutes?

5 Answers   Amazon,


Categories