简体   繁体   English

如何通过 Z1787D7646304C5D987CF4E64ZA 将 Windows cmd output 从本地机器重定向到远程文件

[英]How to redirect Windows cmd output from local machine to remote file via ssh

How can I redirect Windows cmd output from a local (windows) machine to a remote machine and save the output as file via ssh. How can I redirect Windows cmd output from a local (windows) machine to a remote machine and save the output as file via ssh.

For example something like this: cmd /C "hostname | ssh user@host cat > remotefile.txt" This is writing 'hostname' as text to remotefile.txt instead of the command output.例如像这样: cmd /C "hostname | ssh user@host cat > remotefile.txt"这是将“主机名”作为文本写入 remotefile.txt 而不是命令 Z78E6221F6393D1356Z.81DB93

Check if the same command, without cmd and with stdin descriptor (as seen here ), would work检查相同的命令,没有 cmd 和标准输入描述符(如此处所示),是否可以工作

hostname | ssh user@host "cat - > remotefile.txt"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从Windows SSH服务器(从远程Windows计算机上的Linux计算机)运行批处理文件本地设置 - How to run a batch file localy from windows ssh server (from linux machine on remote windows machine) 如何将 Windows cmd 输出重定向到文本文件? - How to redirect Windows cmd output to a text file? How ansible copy file from remote windows to remote linux without local copy and ssh install in windows - How ansible copy file from remote windows to remote linux without local copy and ssh install in windows 如何将输出从CMD窗口重定向到文件 - How to redirect output from CMD window to file 使用python将文件从本地计算机传输到远程Windows服务器 - Transfer file from local machine to remote windows server using python 如何将 SSH 从本地 linux 到 windows 10 远程上的特定目录 - How to SSH from local linux into specific directory on windows 10 remote Windows cmd重定向子命令输出到文件 - Windows cmd redirect subcommand output to file 如何通过Windows CMD捕获和显示任务的输出 - How to capture and display output from a task via Windows CMD 如何使用 ssh 将 git 推送到远程 windows 机器 - How to git push to a remote windows machine using ssh 如何在远程Windows机器上打开文件并查看 - How to open a file and view on remote windows machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM