Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I am dumping some debug info into a text file that I am using tail -f to monitor.

Is there a tool that I can then pipe that tail -f data into to be able to search the text on screen using regular expression commands like search in vim.

share|improve this question
see if the answers in unix.stackexchange.com/questions/25211/… can do what you want. the OP there wanted it to alert, but there's an example using regexes to match and beep. you could use the same regex matching, and have your own action. – Tim Kennedy Jul 27 '13 at 5:57
not quite I want to be able to explore the data not highlight something specific. I have all this async stuff flying around so other then searching through the output its a shot in the dark to find what I want. – Prospero Jul 27 '13 at 6:03

Use less. Start less on the text file you want to monitor:

less some_file

If you want to search for a pattern, ues a slash to start a search a pattern:

/<pattern>  # forward search
?<pattern>  # backward search

If you want to filter the output use an ampersand:


Then start the continuous output using shiftf. You can exit the continuous output display with ctrlc and refine or cancel your filter pattern or start a search.

share|improve this answer
This does not work if the file is truncated = / any advice on getting around this? – Prospero Jul 27 '13 at 21:28
@JamesAndino Type :e Enter to reload the file if it has changed. – Gilles Jul 27 '13 at 22:25
word im just being crazy ocd about my tools again aint i – Prospero Jul 28 '13 at 2:37

If you can't find anything else, you could try seetxt, which can monitor and update a loaded file at configurable intervals (1 second granularity), and has PCRE searching.

Unfortunately it does too many other things as well; I wrote it about 5 years ago and it was my first "big" C project; the source is pretty ugly, lol, but it generally works with some caveats that shouldn't affect what you are doing unless the input is very large or contains a lot of odd characters.

That said, it's something I'd think about revamping for exactly this purpose if it's a niche that lacks. I generally just stop/start things and deal with static logs when debugging, but something that streamed input and did regexps is a good idea.

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.