I'd like to run this command:

watch -n 1 tail -n 200 log/site_dev.log | grep Doctrine

But it does not run, because "I think" that the grep tries to run on the watch instead of the tail...

Is there a way to do something like

watch -n 1 (tail -n 200 log/site_dev.log | grep Doctrine)

Thanks a lot!

link|improve this question

44% accept rate
feedback

2 Answers

Surround the command with quotes

watch -n 1 'tail -n 200 log/site_dev.log | fgrep Doctrine'
link|improve this answer
Thanks for this!!! It works fine – Tom May 12 '10 at 19:31
feedback

I might be wrong, but wouldn't

tail -f -n 200 log/site_dev.log | grep Doctrine

achieve the same thing more simply?

link|improve this answer
WONDERFUL! :) Thanks that is very good! – Tom May 12 '10 at 20:18
feedback

Your Answer

 
or
required, but never shown

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