【问题标题】:How do I put Output command telnet in file [closed]如何将输出命令 telnet 放入文件 [关闭]
【发布时间】:2016-02-14 12:53:29
【问题描述】:

如何将输出命令telnet 放入文件中?

telnet www.google.com 80 > file.txt 
GET / /HTTP/1.1 

为什么我错了?

【问题讨论】:

    标签: linux ubuntu telnet


    【解决方案1】:

    没错...我不知道为什么它不起作用,但是您可以使用 tee 来。

    command | tee ~/outputfile.txt
    

    稍作修改也会捕获 stderr:

    command 2>&1 | tee ~/outputfile.txt
    

    或者只是输入更少的字符:

    command |& tee ~/outputfile.txt
    

    如果您希望能够在实时查看命令输出的同时捕获命令输出,则 tee 非常有用。

    【讨论】:

    • 什么是 tee ~/outputfile.txt ??请给我一个例子
    • Noooo telnet google.dz 80 > a.txt 不正确!!
    • telnet www.google.com 80 | tee file.txt
    • 我测试了telnet www.google.com 80 > file.txt 并且工作正常
    • 哦,是的thanx luiz lago
    猜你喜欢
    • 2011-08-30
    • 1970-01-01
    • 1970-01-01
    • 2014-04-21
    • 2015-02-28
    • 2014-05-15
    • 2016-04-30
    • 2012-02-18
    • 2021-02-26
    相关资源
    最近更新 更多