簡體   English   中英

當管道傳遞到xxd時,為什么某些文本未經修改就通過了?

[英]When piping to xxd, why is some text passed through without modification?

netstat  -lntup |grep  3306  
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN 

mysqld正在運行,前兩行是提示,您必須是root用戶才能看到所有內容。

netstat  -lntup |grep  3306  |xxd
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
00000000: 7463 7020 2020 2020 2020 2030 2020 2020  tcp        0    
00000010: 2020 3020 3132 372e 302e 302e 313a 3333    0 127.0.0.1:33
00000020: 3036 2020 2020 2020 2020 2020 302e 302e  06          0.0.
00000030: 302e 303a 2a20 2020 2020 2020 2020 2020  0.0:*           
00000040: 2020 2020 4c49 5354 454e 2020 2020 2020      LISTEN      
00000050: 2d20 2020 2020 2020 2020 2020 2020 2020  -               
00000060: 2020 2020 0a  

為什么前兩行不能以二進制格式顯示?
為什么只有tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN顯示為二進制格式?

帶括號的文本被寫入標准錯誤,而不是標准輸出,因此被直接寫入終端,而不是grep傳遞給xxd的管道。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM