limingchenxi
V2EX  ›  问与答

请教个 fping 命令回显写入的问题

  •  
  •   limingchenxi · Dec 22, 2017 · 2395 views
    This topic created in 3257 days ago, the information mentioned may be changed or developed.

    我想让 fping 命令运行后回显写入文件。

    fping -c 1 -u -t 1000 114.114.114.114 114.114.114.115 > 1.txt
    fping -c 1 -u -t 1000 114.114.114.114 114.114.114.115 |tee  1.txt
    

    想让回显:

    114.114.114.114 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 46.7/46.7/46.7
    114.114.114.115 : xmt/rcv/%loss = 1/0/100%
    

    其结果写入文件

    试过上面两命令都不行,请问各位有其他方法么?

    2 replies  •  2017-12-23 00:08:17 +08:00
    mYYnSmiTEQWcCwAr
    mYYnSmiTEQWcCwAr
    Dec 23, 2017 via Android❤️1
    1
    末尾加上 2>&1
    表示把 stderr 合并到 stdout
    limingchenxi
    limingchenxi
    OP
    Dec 23, 2017
    2
    @cy97cool 感谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2465 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 04:50 · PVG 12:50 · LAX 20:50 · JFK 23:50
    ♥ Do have faith in what you're doing.