Scroll to navigation

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 中獨特的條目。

BUGS

在基於 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