[英]How to create a desktop shortcut that launches Cygwin and tails a particular file?
I would like to have a desktop shortcut open cygwin so that I can tail a log file.我想有一个桌面快捷方式打开 cygwin 以便我可以跟踪日志文件。
Currently I perform the following steps manually:目前我手动执行以下步骤:
- Start cygwin启动cygwin
- cd dev/server/logs cd 开发/服务器/日志
- tail -f error.log尾 -f 错误日志
I would like to automate the three steps.我想自动化这三个步骤。
You could create a Windows shortcut to the following target...您可以为以下目标创建 Windows 快捷方式...
C:\cygwin\bin\tail.exe -f "C:\Path\to\the\error.log"
...assuming that's where your tail executable is. ...假设那是您的尾部可执行文件所在的位置。 Doing which tail
in a Cygwin shell should confirm that.在 Cygwin shell 中执行which tail
应该可以确认这一点。
That should run the binary in a cmd window.这应该在 cmd window 中运行二进制文件。 Do Ctrl-C
to stop it.执行Ctrl-C
以停止它。
EDIT: Oh, one thing I forgot... This might require "C:\cygwin\bin" in your PATH env variable.编辑:哦,我忘记了一件事......这可能需要在您的 PATH 环境变量中添加“C:\cygwin\bin”。
Is there a specific reason to perform the tail
operation from cygwin shell?从 cygwin shell 执行tail
操作是否有特定原因? If not, you can use the tail for windows and create a shortcut that will point to tail.exe -f error.log
如果没有,您可以使用windows 的 tail并创建一个指向tail.exe -f error.log
的快捷方式
If for some reason, you require cygwin shell, try Andy's approach, that should work for you.如果出于某种原因,您需要 cygwin shell,请尝试 Andy 的方法,这应该适合您。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.