I am using the below command to search through a stream of data being generated. The log file is generated by a long running process and the log mechanism keeps rotating the log file. So, the current file 'aFile.log' will be renamed to 'aFile.log.1' based on certain criteria(such as file size or time change) and a new 'aFile.log' will be created. The following command just hangs in there. Is there a work around for this?
tail -f aFile.log | grep aString
Use -F
instead of -f
to track by filename.
tail -F aFile.log | grep aString