로그 파일이 기록되는 동안 출력을 볼 수있는 Unix ‘tail’명령과 동등한 기능을 찾고 있습니다.
답변
Win32 용 GNU 유틸리티 와 같은 것을 설치하는 것이 좋습니다 . 꼬리를 포함하여 가장 좋아하는 것들이 있습니다.
답변
PowerShell을 사용하면 다음과 같이 작동합니다.
Get-Content filenamehere -Wait -Tail 30
아래에서 Stefan의 의견을 게시하므로 사람들은 놓치지 마세요.
PowerShell 3에는 마지막 x 줄만 포함하도록 -Tail 매개 변수가 도입되었습니다
답변
답변
Cygwin의 일부로 꼬리를 얻을 수 있습니다 .
답변
배치 명령을 사용하여 DOS CMD 테일에 관심이있는 사람 (아래 참조).
그것은 지사가 아니며 때로는 반복됩니다.
사용법 : tail.bat -d tail.bat -f -f
@echo off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
rem tail.bat -d <lines> <file>
rem tail.bat -f <file>
rem ****** MAIN ******
IF "%1"=="-d" GOTO displayfile
IF "%1"=="-f" GOTO followfile
GOTO end
rem ************
rem Show Last n lines of file
rem ************
:displayfile
SET skiplines=%2
SET sourcefile=%3
rem *** Get the current line count of file ***
FOR /F "usebackq tokens=3,3 delims= " %%l IN (`find /c /v "" %sourcefile%`) DO (call SET find_lc=%%l)
rem *** Calculate the lines to skip
SET /A skiplines=%find_lc%-!skiplines!
rem *** Display to screen line needed
more +%skiplines% %sourcefile%
GOTO end
rem ************
rem Show Last n lines of file & follow output
rem ************
:followfile
SET skiplines=0
SET findend_lc=0
SET sourcefile=%2
:followloop
rem *** Get the current line count of file ***
FOR /F "usebackq tokens=3,3 delims= " %%l IN (`find /c /v "" %sourcefile%`) DO (call SET find_lc=%%l)
FOR /F "usebackq tokens=3,3 delims= " %%l IN (`find /c /v "" %sourcefile%`) DO (call SET findend_lc=%%l)
rem *** Calculate the lines to skip
SET /A skiplines=%findend_lc%-%find_lc%
SET /A skiplines=%find_lc%-%skiplines%
rem *** Display to screen line when file updated
more +%skiplines% %sourcefile%
goto followloop
:end
답변
많은 옵션이 있지만 모든 고급 기능에 결함이 있습니다.
-
GnuWin32 꼬리 는 버그가 있습니다 ( α β γ )–f와 같은 것은 작동하지 않습니다.
-
UnxUtils 꼬리가 더 좋아 보이지만 (-f는 작동하지만 –pid는 ~ n은 아니지만 –lines = n은 -f와 함께 실패하는 것처럼 보이지만) 죽은 프로젝트 인 것처럼 보입니다.
-
Cygwin 은 매우 추악하고, 아마도 DLL 및 coreutils 패키지를 사용할 수는 있지만 여전히 pid와 같은 문제는 네이티브 win32 프로세스에서 작동하지 않습니다.
![](http://daplus.net/wp-content/uploads/2023/04/coupang_part-e1630022808943-2.png)