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 the shell for dos,nt operating systems?

1 Answers  


What is the different between UNIX command and UNIX shell script?

2 Answers  


What is ctrl d?

0 Answers  


Write a command to find all of the files which have been accessed within the last 30 days.

14 Answers   Cisco,


What is the basic difference between unix and windows operating systems?

43 Answers   Bopro, College School Exams Tests, CTS, IBM, IT-Kids, Priyadarshini, Sybian Technologies, Tolani Maritime,






what these two commands prints "echo test","cat test"?

6 Answers   TCS, Wipro,


What is FIND, GREP and SED ? Could you please give me the difference between all the three? Where we use this commnands?

6 Answers   Deloitte, Polaris,


how to change a normal file into hidden file

3 Answers  


distinguish between interrupts and exceptions?

2 Answers   Infosys, Wipro,


what are the different hardwares available?

1 Answers  


What is the use of tee command?

0 Answers  


what is the use of nice command?

4 Answers  


Categories