Viewing a huge for read only and looking for a specific word

Hi everyone,
I am working from my windows workstation on VPN to our servers, where have Linux installed. I want to read only a log file, which is huge and I only wan to look at the lat 2000 lines, but when I use the command tail -2000 filename.log  I cant browse up the black window of the VPN to see the rest of the view, so am I doing wrong??
Many thanks
Miss “B”

Who is Participating?
pjedmondConnect With a Mentor Commented:

tail -n2000 filename.log > anotherfile.txt

You can then view anotherfile.txt in your favourite editor...and also use any search/pattern matching tools rather than just searching through 2000 lines with the naked eye:)

or...if you are only interested in certain lines:

tail -n2000 filename.log | grep "interesting error"

selects only lines containing the text "interesting error". Obviously you can | this to more (or less) or send the output to a file.

Same applies if you want some lines removed:

tail -n2000 filename.log | grep -v "boring error"

Obviously this can be chained:

tail -n2000 filename.log | grep -v "boring error" | grep -v "boring error2"

etc. And again you can send this to 'more' or a file.

bobgunzelConnect With a Mentor Commented:
tail -n2000 filename.log | more
If less is installed then use less instead of more. Less allows you to browse upwards.
mbayaderAuthor Commented:
Many thanks guys, that was good.
Best regards,
Miss "B"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.