aix命令之_capture 和 script

wmlm發表於2007-03-07
將螢幕複製到檔案(capture 和 script 命令)[@more@]

將螢幕複製到檔案(capture 和 script 命令)
使用 capture 命令(該命令模擬 VT100 終端)將在終端上列印的任何東西複製到您指定的檔案。使用 script 命令,在不模擬 VT100 終端的情況下,將在終端上列印的任何東西複製到您指定的檔案。

這兩個命令對列印終端對話方塊的記錄都是相當有用的。
例如,要在模擬 VT100 的情況下捕獲終端螢幕,請在提示符處輸入以下命令:
capture screen.01
系統顯示與以下類似的資訊:
Capture command is started. The file is screen.01.
Use ^P to dump screen to file screen.01.
You are now emulating a vt100 terminal.
Press Any Key to continue.
輸入資料並轉儲螢幕內容之後,按下 Ctrl-D 或者輸入 exit 然後按 Enter 鍵可停止 capture 命令。系統顯示與以下類似的資訊:
Capture command is complete. The file is screen.01.
You are NO LONGER emulating a vt100 terminal.
使用 cat 命令來顯示檔案內容。

例如,要捕獲終端螢幕,請在提示符處輸入以下命令:
script
系統顯示與以下類似的資訊:
Script command is started. The file is typescript.
螢幕上的所有顯示現在被複制到 typescript 檔案。

要停止 script 命令,按下 Ctrl-D 或者輸入 exit 並按 Enter 鍵。系統顯示與以下類似的資訊:
Script command is complete. The file is typescript.
使用 cat 命令來顯示檔案內容。

請參閱《AIX? 5L V5.3 命令參考大全》中的 capture 和 script 命令以瞭解完整語法。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/271063/viewspace-903239/,如需轉載,請註明出處,否則將追究法律責任。