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

Can you enlist some commonly used network commands?

1054


What is “chmod” command?

1099


Which command is used to delete all files in the current directory and all its sub-directories?

1210


What does the md command do?

1075


What is the use of awk command in unix?

1071


What is difference between grep and find command in unix?

1144


What is command substitution?

1269


What does grep v grep do?

1025


Which command is used to create a directory?

1097


Explain mount and unmount command.

1148


What is a bash command?

1116


Which command is used to kill the last background job?

1292


Name the various commands that are used for the user information in unix.

1023


What is command statement?

1106


Name the unix command to find how many days the server has been up.

1114