Sometimes it happen that: for mistakes, because you don’t rotate your logs or perhaps they growth up really quickly, that you need to analyse a large file (> 1GB) for searching a specific pattern of text. Probably you’ll go nowhere if you try to open them with
vi or worst with a graphical editor like Gedit or libreoffice, and if your resource are low you risk to use all the memory and put your linux box in hang.
But don’t worry, like many things in Unix/Linux, there is a specific tool that can help you in this operation: Rowscope
Rowscope is a graphical file viewer for large text files. It can read files larger than 1 GB.
Rowscope is written in Scala and uses SWT for the GUI.
The program it’s distributed from the official download page as a .jar package, so you just need to have java installed to run it.
The idea behind Rowscope is that a person cannot read the whole file when it is so large; a person can only read some parts of the file, possibly the ones that contain the information he is looking for.
For example when somebody reads the log file produced by an application, he will probably look for a specific error or for the lines produced in a specific period of the day.
What the user can do with Rowscope
- Localizes the part or parts of the file that he wants to read, using search strings or regular expressions.
- Then he can expand one of the rows he has found, which means that he makes Rowscope display the rows immediately before or after that row.
Going back to the log example, let’s say the user wants to find what caused an error in the application. Knowing that the application logs its errors, he searches for the word ERROR. Once that the user find the line with that string he can choose to expand further lines and analyse what’s happened just before that event.
Rowscope it’s really easy to use, just choose your file, put the string you want to search and you are done.
The following picture (from the official site) describes each part of the GUI:
- None Found