Wednesday 18 December 2013

Tail the Logs - Unix

Tail is just another basic command in Unix where you can 'tail' a certain file to view its contents Bottoms-up.

Usage:

tail -lines <file-name>

Eg:

To view last ten lines of a file log.txt. Note the -n switch

tail -n 10 log.txt

To view the live results of a logfile use the -f switch

tail -f logfile.txt

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker