View lastest content in the file

Hi,
May i know how can i view the lastest content of the log file. Currently, i use the "more" command :
more logfile

However, it will give me the content last year first and i had to keep using the space bar to move down to the lastest content for current date. How can i view the lastest content of the first ?

Regards
Lauran

Check the man page for the TAIL command - may be what you are looking for. Tail -f sounds like it will do what you are requesting.

The more utility on AIX can be steered the same way as vi: the following key combination will all work:

<SHIFT>-<g>    go to the end of the file, 
<j>            scroll down (forward) one line
<k>            scroll up (backwards) one line
<u>            scroll up (backwards) half a screen content
<d>            scroll down (forwards) half a screen content
<n><SHIFT>-<g> go to the <n>-th line ("1G" -> go to first line)

Use the tail utility, as has already been mentioned.

Alternatively use sed to display the last line or group of last lines, like this:

sed -n '$p' /path/to/file (will display the last line)

Alternatively use the sort utility to reverse order of lines in the file prior to displaying it:

sort -r /path/to/file | more

And finally there are perhaps a dozen of other possiblities to achieve the same which i just don't know of.

Hope this helps.

bakunin

Hi All,
Thanks for all the good option. I manage to get what i want from those command.

Thanks