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.
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- CosmosDB emulator can't start since port is al
- How to print to stdout from Python script with .py
- Determine if an executable (or library) is 32 -or
Graphical log viewers, while they might be very good for viewing log files, don't meet the need for a command line utility that can be incorporated into scripts (or batch files). Often such a simple and general-purpose command can be used as part of a specialized solution for a particular environment. Graphical methods don't lend themselves readily to such use.
If you use PowerShell then this works:
Posting Stefan's comment from below, so people don't miss it
PowerShell 3 introduces a -Tail parameter to include only the last x lines
I prefer TailMe because of the possibility to watch several log files simultaneously in one window: http://www.dschensky.de/Software/Staff/tailme_en.htm
You can get tail as part of Cygwin.
I haven't seen Log Expert anywhere among answers here.
It's customizable and is quite good for going around log files. So far it's the best Windows graphical log viewer for me.
There are quite a number of options, however all of them have flaws with more advanced features.
The Windows Server 2003 Tools provides a simple tail that can be downloaded with the Resource Kit Tools. It is too limited in many respects (locks followed file, lacks many options like --pid), however will do for the basic task of tracking a file.
GnuWin32 tail is buggy (α β γ) - things like -f just plain don't work.
UnxUtils tail seems better (-f works, but --pid seems not to, -n but not --lines=n fails with -f), but appears to be a dead project.
Cygwin is a big ugly mush, could perhaps just use the DLL and coreutils package - but still has problems like --pid not working with native win32 processes.