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

what is the command to print last 8 lines of any text file.

Answer Posted / santosh sathe

1) use tail -8 filename

2) This will print last three lines of a file

cat 1.lst

hi
hello
bye
good
morning


sed -n '1,2!p' 1.lst

o/p

bye
good
morning

The last 3 lines are printed.sed command uses !(negation)
operator for skipping the 1st and 2nd line,That means it
will print all the lines except 1st and 2nd.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between cat command and more command?

1219


What is the difference between cat and more command?

1319


Differentiate cat command from more command.

1170


What is the functionality of a top command?

1122


Is grep faster than awk?

1054


What is grep command in unix with examples?

1236


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

1239


What is grep r?

1117


How can we use grep command in unix?

1224


What is the use of cut command in unix?

1388


What is the use of finger command?

1230


What does sed command do in unix?

1213


What command is used to switching between users in unix?

1099


What's a command word?

1193


What happens when we execute a unix command?

1159