简体   繁体   English

如何创建启动 Cygwin 并跟踪特定文件的桌面快捷方式?

[英]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:目前我手动执行以下步骤:

  1. Start cygwin启动cygwin
  2. cd dev/server/logs cd 开发/服务器/日志
  3. 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.

相关问题 无法在桌面上为远程IP文件创建快捷方式 - Unable to create shortcut on Desktop for a remote IP file 如何在用户桌面上创建计算机的快捷方式 - How to create shortcut to Computer on the user's desktop 如何使用Powershell在桌面上创建磁盘快捷方式? - How to create Disk shortcut on desktop using Powershell? 如何在命令提示符下创建特定命令的快捷方式? - How to create a shortcut to a particular command in command prompt? 以编程方式为桌面“快捷方式”创建快捷键组合 - Programmatically create shortcut keys combo for desktop “shortcut” 在桌面上自动为Chrome创建网站快捷方式 - Create shortcut to website in chrome on desktop automatically 如何使用Visual Studio安装程序在所有应用程序菜单中创建桌面应用程序的快捷方式 - How to create shortcut to desktop app in the all apps menu using Visual Studio Installer 如何从启用了“以管理员身份运行”的基于 WiX 的安装程序安装桌面快捷方式(到批处理文件)? - How to install a desktop shortcut (to a batch file) from a WiX-based installer that has “Run as Administrator” enabled? 如何从桌面快捷方式显示/隐藏任务栏 - How to show/hide taskbar from a desktop shortcut 如何使用桌面快捷方式启动.jar文件(针对特定的jre) - How do I launch a .jar file with desktop shortcut (targeting a specific jre)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM