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

Answers were Sorted based on User's Feedback



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

Answer / jupiter

#tail -n 8 <file-name>

Is This Answer Correct ?    55 Yes 16 No

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

Answer / sravani

tail -8 <filename>

Is This Answer Correct ?    39 Yes 4 No

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

Answer / syed shariq hussain

tail -8 <FILENAME>

Is This Answer Correct ?    33 Yes 1 No

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

Answer / deeps

tail -8f filename

Is This Answer Correct ?    14 Yes 7 No

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

Answer / ravikishore

cat <f.n> | tail -8

Is This Answer Correct ?    2 Yes 0 No

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

Answer / kiruthiga.s

tail + 8

Is This Answer Correct ?    0 Yes 0 No

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

Answer / meghna

sed -n '$-8 , $p' filename

Is This Answer Correct ?    0 Yes 1 No

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

Answer / 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

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

Answer / indu sharma

cat <filename> | head -n 8

Is This Answer Correct ?    2 Yes 17 No

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

Answer / chandrani

head -8 <file name>

Is This Answer Correct ?    9 Yes 84 No

Post New Answer

More Unix Commands Interview Questions

what is mount ,tell me about mount ,how can u use in real time project??

12 Answers   Symphony,


what do you understand by 'building block primitive'?

3 Answers   Infosys,


In Unix file permissions what does the second field denotes?

3 Answers  


What does find command return in unix?

0 Answers  


How do you grep recursively?

0 Answers  






Write a command to kill the last background job?

0 Answers  


Why we are using UNIX OS when we are doing the testing in our application?

5 Answers   IBM,


What is the command to compare two files in unix?

0 Answers  


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

0 Answers  


How do I run a bash script?

0 Answers  


what is the difference between commmands cmp and diff?

9 Answers   iNautix,


Write a command to display a file’s contents in various formats?

0 Answers  


Categories