Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?


share|improve this question
Your commands work for me. How long is "very long"? (eg. how many lines? or MB or GB?) .. You have used tail -f, so I assume the file is growing. Is it growing very rapidly? .. and by the way, in Ubuntu pico is actually nano. To see this, run: readlink -e $(which pico) .. I've not used pico/nano before, but the man page only mentions a commandline option to open the file at a specific line,column, eg. pico +1000,7 filename ... PS.. it does take quite a while for the tail/awk combo to catch up with the new line additons when I add many lines very fast. This may be the proplem – Peter.O Mar 23 '11 at 11:55
up vote 2 down vote accepted

Using nano for logfiles is not recommended as it loads the whole file into the memory. Use less:

less /var/log/lighttpd/website/error.log

Press F to get the effect from tail -f.

share|improve this answer

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...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.