سؤال

I have BusyBox v1.21.0 installed and it has got very basic grep operation, no --line-buffered option

grep sync_complete /var/log/messages
tail -f /var/log/messages | grep sync_complete

is it possible to combine above commands into single line command? thanks!

هل كانت مفيدة؟

المحلول

Use -n +1 to make tail read the file from the start:

tail -n +1 -f /var/log/messages | grep sync_complete
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top