2013-10-16 45 views

回答

0

默認情況下bash輸入的命令保存在~/.bash_historypsql將其保存在~/.psql_history,所以你可以發送帶有此命令的文件:

$ mail -s 'My history files' -a ~/.bash_history -a ~/.psql_history [email protected] 

請注意,並非所有mail命令支持-a標誌派附件,ubuntu中的heirloom-mailx。

+0

感謝您的回答,但我有另一個問題:當我嘗試訪問文件.bash_history,我有一個權限被拒絕的錯誤。什麼是它的原因? –

+0

你是文件的所有者嗎?否則你必須是root。 –

+0

我有和su root相同的錯誤記錄 –