Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Each time I've been looking for "something I don't know exactly what" in big text file, e.g. log-file, huge shell script, I wish to hide all the lines of certain types.

I wish to select certain lines with a set of regexps and either hide them or highlight.

It would be nice if I could select line blocks e.g. those lines between "function ...() {" and corresponding "}"

can you suggest me such a viewer?

share|improve this question
I like egrep although it has to be used from the terminal. Assuming you are in the directory that holds the file called input, egrep -v '^#|^ *$' input > output will exclude lines that are commented with a # at the beginning of lines and lines that are not blank and write the results to the file called output in the same folder. Obviously, you can modify the criteria depending on the content of your file. – user25656 Jan 30 '12 at 16:45
Many text editors will do syntax highlighting. Tools such as grep, awk, perl will help you search your logs. – bodhi.zazen Jan 30 '12 at 16:51
yes i'm aware of grep, awk, other cool text processing stuff, but in the context I described abowe I find them not convenient. I need GUI viewer with ability to switch on/off certain regexp by clicking a checkbox, also it would be very helpful to have an option to extract to separate tab all the lines with defined regexp. – zuba Jan 30 '12 at 18:49
gnome-system-log has such filters but they are implemented such way, that I could hardly use them. – zuba Jan 30 '12 at 18:56

Here are 5 of the best viewers

MultiTail View multiple logfiles windowed on the console

System Log Viewer A system log viewer for GNOME

KSystemLog System log viewer for KDE 4

Xlogmaster GTK+ based program to keep track of logfiles and devices

Swatch Logfile viewer with regexp matching, highlighting & hooks


share|improve this answer

Have you tried regexxer? It can highlight matches and you can jump from match to match but it won't filter just matches. Similarly like gnome-system-log but more easy to use

I could also show you how to filter regex matches (display only matching lines) in SciTE editor, with small LUA script, and I imagine many others can show you how to with vim or emacs, but you didn't mention which editor you use.

share|improve this answer
Thank you for url, I found regexxer very helpful utility. But I need other tool. When I look at a file which contains many lines e.g. when I study ubuntu logs, I want to hide all the lines I know meaning of. That helps to unearth lines I'd like to learn more about. I prefer gvim. – zuba Jan 30 '12 at 20:35

You can try Geany [GUI]

regx for multiple line is not supported bust you can use - and + to hide/show portion of text such as functions ({...}).

It support may languages including xml.

share|improve this answer

Have you tried vim with folds? It can fold code blocks very well.

:set foldmethod=indent

This command sets fold method based on indentation.

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.