まさにそのままのがggったらあった。
Windows で tail -f する方法 - maruko2 Note.
Get-Content コマンドレットのエイリアス[1]として cat, gc, type が登録されているので、cat でも同じ結果になる。
cat "LogFiles\Firewall\pfirewall.log" -wait -tail 10
C:\tmp> powershell
Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
PS C:\tmp> cat a.txt -wait
aaaaa
aaa
aa
aa
golangではgotailというパッケージがあるらしい
$ go get github.com/ActiveState/tail
$ cp src/github.com/ActiveState/tail/cmd/gotail/gotail.go .
$ go build gotail.go
$ GOOS=windows GOARCH=amd64 go build gotail.go
$ ./gotail -h
Usage of ./gotail:
-F=false: follow, and track file rename/rotation
-f=false: wait for additional data to be appended to the file
-max=0: max line size
-n=0: tail from the last Nth location
-p=false: use polling, instead of inotify
$ ./gotail -f a.txt
aaaaa
aaa
aa
aa
Windowsでも動く
PS C:\tmp> .\gotail.exe -h
Usage of C:\tmp\gotail.exe:
-F=false: follow, and track file rename/rotation
-f=false: wait for additional data to be appended to the file
-max=0: max line size
-n=0: tail from the last Nth location
-p=false: use polling, instead of inotify
PS C:\tmp> .\gotail.exe -f a.txt
aaaaa
aaa
aa
aa
参考
複数ファイルの tail -f を heroku logs っぽく表示する「9t」 - Thanks Driven Life
http://gongo.hatenablog.com/entry/2015/03/09/221231
↑ソースはそんなに長くないのでgolangの勉強になる
ActiveState/tail
https://github.com/ActiveState/tail