心理

當前位置 /首頁/完美生活/心理/列表

linux中stdout是什麼

linux中stdout是什麼

我的回stdout是終端的標準輸出。

我的分析:在Linux中執行命令,一般會開啟三個標準檔案。包括:標準輸入檔案stdin,標準輸出檔案stdout和標準錯誤輸出的檔案stderr。

std代表標準的:standard,input/output表示輸入/輸出。err代表error錯誤。

標準輸入檔案,一般是stdin,對應的終端是鍵盤。

標準輸出檔案stdout和標準錯誤輸出檔案stderr,對應的終端是螢幕。

一般程序從標準輸入檔案中得到輸入資料,比如引數。把正常輸出資料輸出到標準輸出檔案stdout,把錯誤資訊送到標準錯誤輸出檔案中。

Linux中一般用0表示stdin標準輸入,用1表示stdout標準輸出,用2表示stderr標準錯誤輸出。

一般在預設的情況下,標準輸出stdout是行緩衝的,是把輸出放到一個buffer裡面,只有換行的時候,才會輸出到螢幕。

一般標準錯誤輸出stderr是無緩衝的,直接輸出。

TAG標籤:Linux stdout #