If I run
sudo pico /var/log/lighttpd/website/error.log
I get a very long file, and I cannot see last lines. If I run:
sudo tail -f /var/log/lighttpd/website/error.log | awk '{print $1 "--" $2}'
I don't get anything ? What am I doing wrong ?
Also, how can I move to a specific line using pico editor ?
thanks
Using nano for logfiles is not recommended as it loads the whole file into the memory. Use
less
:Press F to get the effect from
tail -f
.If you want to read only the last lines of the log use
tail -aNumber /var/log/lighttpd/website/error.log
Replacing aNumber with the number of lines you want to see.
If you want to see the whole file use
vi /var/log/lighttpd/website/error.log
you could also use nano, it´s easier...