STDBUF(1) | 用戶命令 | STDBUF(1) |
stdbuf - 運行給定的命令,同時改變該命令對應標準輸入輸出流的緩衝操作配置。
stdbuf 選項... 命令
運行給定的命令,同時改變該命令對應標準輸入輸出流的緩衝操作配置。
必選參數對長短選項同時適用。
若模式是 "L",則相應的流將是行緩衝模式。標準輸入流下此選項無效。
若模式是 "0",則相應的流將不緩衝。
Otherwise MODE is a number which may be followed by one of the following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y. Binary prefixes can be used, too: KiB=K, MiB=M, and so on. In this case the corresponding stream will be fully buffered with the buffer size set to MODE bytes.
注意:若指定的命令調整了其自身的標準流緩衝區(例如 tee 命令),則此操作會覆蓋由 "stdbuf" 工具所做出的相應設置。還有某些過濾器程序(如 "dd" 和 "cat" 之類)不使用輸入輸出流,因此不受 "stdbuf" 設置的影響。
tail -f access.log | stdbuf -oL cut -d ' ' -f1 | uniq
這樣會立刻顯示 access.log
中獨特的條目。
在基於 GLIBC 的平臺上,指定緩衝大小(即使用全緩衝模式)通常會導致未定義的操作。
由 Padraig Brady 編寫。
GNU coreutils 的在線幫助:
<https://www.gnu.org/software/coreutils/>
請向 <https://translationproject.org/team/zh_CN.html>
報告翻譯錯誤。
Copyright © 2020 Free Software Foundation, Inc. License
GPLv3+: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
完整文檔請見:
<https://www.gnu.org/software/coreutils/stdbuf>
或者在本地使用: info
'(coreutils) stdbuf invocation'
本頁面中文版由中文
man 手冊頁計劃提供。
中文 man
手冊頁計劃:https://github.com/man-pages-zh/manpages-zh
2020年三月 | GNU coreutils 8.32 |