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

Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

0 Answers  


If JFS file system is 100% full how we can increase the file system ?

3 Answers  


Write a command to kill the last background job?

0 Answers  


What are the dos commands?

0 Answers  


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

12 Answers   Symphony,






what is the command to find out which shell you are running?

14 Answers  


How does one process we can start an executable file? How to get the PID process, which we started?

6 Answers  


hw will u use awk in replacing cahrs and files

0 Answers  


Describe the zip/unzip command using gzip.

0 Answers  


Can you enlist some commonly used network commands?

0 Answers  


How to view the hidden files in /etc directory?

10 Answers  


In UNIX, what is the command to edit contents of the file?

9 Answers  


Categories