When using less pressing Shift-F takes to the end of the file, and continuously display new contents. Is there any option (with any *nix tool) to continuously display new content which contains a given string (e.g. look for a word error)?

As @Fedor Dikarev pointed out in comments tail -f /var/log/program.log | grep error allows for that. However, is there any option to look for a string and have a possibility to change word to be searched for? grep won't allow for that.

  • tail -f /var/log/program.log | grep error – Fedor Dikarev Jul 24 '19 at 8:35
  • Thanks! Is there an option to change the word to be searched for dynamically? grep won't allow for that. – menteith Jul 24 '19 at 8:39
  • @menteith Re-execute the pipeline with a new word would do that. What do you mean? – Kusalananda Jul 24 '19 at 8:42
  • @Kusalananda Sorry, I don't think I know what you mean. – menteith Jul 24 '19 at 8:44
  • If you re-ran the tail -f + grep pipeline with a new word, that would look for that new word instead. What do you mean by "dynamically"? – Kusalananda Jul 24 '19 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.