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,


How does a user get the current date, time in UNIX?

6 Answers   IBM,


What is an Unix command to convert HEX value to ASCII value located in any flat file.

2 Answers  


Can a process kill itself in UNIX/or in its various versions?

2 Answers  


What UNIX command will control the default file permissions when files are created?

4 Answers  


How do you grep recursively?

0 Answers  


what is the use of ls -l command & what is the information it gives about user ?

5 Answers  


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

9 Answers  


What is the functions of zambie process?

3 Answers  


How would you find the size of a file or directory?

1 Answers  


Explain the steps that a shell follows while processing a command.

0 Answers  


What are file commands?

0 Answers  


Categories