A Windows equivalent of the Unix tail command [clo

2019-01-01 06:23发布

I'm looking for the equivalent of the Unix 'tail' command that will allow me to watch the output of a log file while it is being written to.

标签: windows tail
26条回答
明月照影归
2楼-- · 2019-01-01 06:46

I'm using Kiwi Log Viewer. It's free.

查看更多
看淡一切
3楼-- · 2019-01-01 06:47

You can try WinTail as well.

ََ

查看更多
人间绝色
4楼-- · 2019-01-01 06:50

Another option would be to install MSYS (which is more leightweight than Cygwin).

查看更多
萌妹纸的霸气范
5楼-- · 2019-01-01 06:52

Try Windows Services for UNIX. Provides shells, awk, sed, etc. as well as tail.

查看更多
荒废的爱情
6楼-- · 2019-01-01 06:52

I just wrote this little batch script. It isn't as sophisticated as the Unix "tail", but hopefully someone can add on to it to improve it, like limiting the output to the last 10 lines of the file, etc. If you do improve this script, please send it to me at robbing ~[at]~ gmail.com.

@echo off

:: This is a batch script I wrote to mimic the 'tail' UNIX command.
:: It is far from perfect, but I am posting it in the hopes that it will
:: be improved by other people. This was designed to work on Windows 7.
:: I have not tested it on any other versions of Windows

if "%1" == "" goto noarg
if "%1" == "/?" goto help
if "%1" == "-?" goto help
if NOT EXIST %1 goto notfound
set taildelay=%2
if "%taildelay%"=="" set taildelay=1

:loop
cls
type %1

:: I use the CHOICE command to create a delay in batch.

CHOICE /C YN /D Y /N /T %taildelay%
goto loop

:: Error handlers

:noarg
echo No arguments given. Try /? for help.
goto die

:notfound
echo The file '%1' could not be found.
goto die

:: Help text

:help
echo TAIL filename [seconds]

:: I use the call more pipe as a way to insert blank lines since echo. doesnt
:: seem to work on Windows 7

call | more
echo Description:
echo     This is a Windows version of the UNIX 'tail' command.
echo     Written completely from scratch by Andrey G.
call | more
echo Parameters:
echo    filename             The name of the file to display
call | more
echo    [seconds]            The number of seconds to delay before reloading the
echo                         file and displaying it again. Default is set to 1
call | more
echo ú  /?                   Displays this help message
call | more
echo    NOTE:
echo    To exit while TAIL is running, press CTRL+C.
call | more
echo Example:
echo    TAIL foo 5
call | more
echo    Will display the contents of the file 'foo',
echo    refreshing every 5 seconds.
call | more

:: This is the end

:die
查看更多
低头抚发
7楼-- · 2019-01-01 06:52

In Far Manager, press F3 on a file to enter the standard viewer, then the End key to navigate to the end of file.

If the file is updated, Far Manager will scroll it automatically.

查看更多
登录 后发表回答