ラボ > サーバ:Xampp、OS:Windows

Win powershellで「tail -f」

CMDではできないらしいが、Win10だとpowershellがあって、これなら「tail -f」が使えるそうだ。

作成日:2019-09-05, 更新日:2022-07-14

基本

1.Win10の左下にある検索窓の「ここに入力して検索」ってトコに「powershell」を検索して起動
2.下記コマンド

Get-Content -Path ファイルのPATH -Tail 10 -Wait

UTF-8のファイルを監視する

Get-Content -Path ファイルのPATH -Tail 10 -Wait -Encoding utf8

▼utf8の「C:\xampp\htdocs\hoge\logs\20190905.log」を「tail -f」したい

Get-Content -Path C:\xampp\htdocs\hoge\logs\20190905.log -Tail 10 -Wait -Encoding utf8

▼cdとかするなら・・・

# cd C:\xampp\htdocs\hoge\logs\
# Get-Content -Path 20190905.log -Tail 10 -Wait -Encoding utf8