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

What is sed awk grep?

0 Answers  


What is command statement?

0 Answers  


How would you find the size of a file or directory?

1 Answers  


What is in grep command?

0 Answers  


what are the different operating systems available?

3 Answers  


Explain ‘library functions’ with respect to unix commands?

0 Answers  


What is the behavioural difference between cmp and diff commands?

0 Answers  


what is the use of "fg" command ?

5 Answers   PSU, Sail,


What is awk used for?

0 Answers  


How do you remove a crontab file?

6 Answers  


How do you change your account's password?

6 Answers  


Which command can you use to find the currently running process in unix server?

0 Answers  


Categories