1.

What is the primary difference between head and tail commands in Linux ?

Answer»


Head
Tail
Head command is used to DISPLAY first few LINES (default is 10) of the FILE.
Tail is used to display last few lines(default is 10) of the file .

#Display first 10 lines of the file - application.log

head application.log

#Display first 50 lines of the file - application.log

head -50 application.log


#Display last 10 lines of the file - application.log

tail application.log

#Display last 50 lines of the file - application.log

tail -50 application.log





Discussion

No Comment Found