你需要 [tail](https://link.segmentfault.com/?enc=hVQjrHb%2F9IbdLLngfCuRbw%3D%3D.dfZsADVvuV7t7LvXNqdpRyzdpbospBhRT%2BpmhE3hv3V8sX2bhKMi8xfKHF3vHBmLoEbgMIv4GT76yZEIsg9LDw%3D%3D) tail -f a.log | nc ...... > ## tail > > `-f, --follow[={name|descriptor}]` > output appended data as the file grows; > an absent option argument means 'descriptor' > > With --follow (-f), tail defaults to following the file > descriptor, which means that even if a tail'ed file is renamed, > tail will continue to track its end. This default behavior is > not desirable when you really want to track the actual name of > the file, not the file descriptor (e.g., log rotation). Use > \--follow=name in that case. That causes tail to track the named > file in a way that accommodates renaming, removal and creation.