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 does #!/ Bin sh do?

1065


What are the general commands in using unix os for a beginner?

1168


Are you in or at the office?

1123


How to find $ai_serual resolved path by using unix

1750


How do you grep a case insensitive?

1044


What is the difference between cat command and more command?

1204


How do I use nslookup?

1092


What are awk commands?

1158


How do I search for a file in unix command?

1019


What is the use of tee command?

1156


What is difference between grep and find command in unix?

1209


What does awk stand for?

1077


How does the system know where one command ends and another begins?

2249


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

1396


why metadb requires a seperate slice to create Solaris volume manager

3156