从命令行将PuTTY输出保存到文件 [英] Save PuTTY ouput to file from command-line

查看:1529
本文介绍了从命令行将PuTTY输出保存到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用命令行将PuTTY输出保存到文件中?我知道使用GUI很容易做到这一点,但就我而言,它必须自动完成。

Is there any way to save the PuTTY output to a file using the command line? I know this is easily done using the GUI but in my case it has to be done automatically.

我在做什么:

用户单击批处理文件->启动PuTTY,通过SSH自动连接到我的设备并运行一堆命令-> PuTTY应该将输出保存到文件

User clicks batch file -> starts PuTTY, automatically connects to my device over SSH and runs a bunch of commands -> PuTTY should save the output to a file.

最后一部分我无法工作。

The last part I can't get working. Is there any command to do this?

推荐答案

可以使用腻子完成此操作。考虑到提问时间,答案来得不晚,但这可能对某人有所帮助。

This can be done with putty. The answer is little late considering the time the questions was asked, however this might help someone.

在油灰中,使用GUI,您可以保存带有日志记录选项的会话,例如如下所示。

In putty, using GUI, you can save sessions with logging option on, as shown below.

输入主机名,命名会话,转到左上角的日志记录选项,选择所有会话,提供日志文件名和位置,然后转到返回会话选项卡,单击保存按钮。完成,您已经保存了一个会话。

Enter Host Name, Name the session, Go to Logging Option in the left top corner, select all sessions, provide log file name and location, go back to Session tab, click on the save button. Done, you have saved a session.

现在打开CMD并按如下所示编写命令

Now open CMD and write the command as below

您已完成。每次调用此会话时,都会记录命令和输出。
希望这会有所帮助。

You are done. Every time this session is invoked, the commands and output will be logged. Hope this helps.

这篇关于从命令行将PuTTY输出保存到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆