rhel5_script自動記錄操作命令歷史序列
-bash-3.2$ script. mylove.txt #開啟記錄功能,把所有的輸入的命令儲存在mylove.txt
Script. started, file is mylove.txt
bash-3.2$ command1
bash: command1: command not found
bash-3.2$ command2
bash: command2: command not found
bash-3.2$ three
bash: three: command not found
bash-3.2$ commdn
bash: commdn: command not found
bash-3.2$ commdn
bash: commdn: command not found
bash-3.2$ last
root pts/0 192.168.19.168 Mon Jun 21 19:19 still logged in
root pts/0 192.168.19.168 Mon Jun 21 13:28 - 19:19 (05:50)
root pts/0 192.168.19.168 Mon Jun 21 10:43 - 11:40 (00:56)
reboot system boot 2.6.18-128.el5 Mon Jun 21 10:41 (08:45)
root pts/2 192.168.19.168 Fri Jun 18 11:30 - down (06:29)
root pts/1 192.168.19.160 Fri Jun 18 11:23 - 13:36 (02:12)
root pts/1 192.168.19.160 Fri Jun 18 11:22 - 11:22 (00:00)
root pts/1 192.168.19.160 Fri Jun 18 11:22 - 11:22 (00:00)
root pts/0 192.168.19.168 Fri Jun 18 09:41 - 11:46 (02:05)
reboot system boot 2.6.18-128.el5 Fri Jun 18 08:28 (09:31)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - crash (15:40)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - 16:47 (00:00)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - 16:47 (00:00)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - 16:47 (00:00)
root pts/1 192.168.19.168 Thu Jun 17 16:39 - 16:47 (00:07)
root pts/0 192.168.19.168 Thu Jun 17 13:37 - crash (18:50)
reboot system boot 2.6.18-128.el5 Thu Jun 17 13:36 (1+04:22)
root tty1 Thu Jun 17 11:12 - down (00:00)
root pts/0 192.168.19.168 Thu Jun 17 09:39 - down (01:33)
reboot system boot 2.6.18-128.el5 Thu Jun 17 09:39 (01:33)
root pts/0 192.168.19.168 Thu Jun 17 09:31 - down (00:06)
reboot system boot 2.6.18-128.el5 Thu Jun 17 09:30 (00:07)
root pts/1 192.168.19.168 Thu Jun 17 09:21 - down (00:07)
root pts/0 192.168.19.168 Thu Jun 17 08:47 - down (00:41)
reboot system boot 2.6.18-128.el5 Thu Jun 17 08:30 (00:58)
root pts/1 192.168.19.160 Sun Jun 13 17:40 - 17:40 (00:00)
root pts/1 192.168.19.160 Sun Jun 13 15:09 - 16:55 (01:45)
root pts/0 192.168.19.168 Sun Jun 13 14:55 - down (02:46)
root pts/1 192.168.19.168 Sun Jun 13 11:48 - 14:40 (02:51)
root pts/2 192.168.19.160 Sun Jun 13 08:56 - 09:54 (00:57)
root pts/1 192.168.19.168 Sun Jun 13 08:27 - 09:54 (01:26)
root pts/0 192.168.19.168 Sun Jun 13 08:23 - 14:40 (06:16)
root pts/2 192.168.19.168 Sat Jun 12 18:05 - 21:58 (03:52)
root pts/1 192.168.19.168 Sat Jun 12 16:48 - 21:58 (05:09)
root pts/0 192.168.19.168 Sat Jun 12 16:45 - 21:58 (05:12)
root pts/0 192.168.19.168 Sat Jun 12 16:08 - 16:45 (00:37)
root tty1 Sat Jun 12 13:45 - down (1+03:55)
root tty1 Sat Jun 12 13:33 - 13:35 (00:02)
root tty1 Sat Jun 12 13:18 - 13:19 (00:00)
reboot system boot 2.6.18-128.el5 Sat Jun 12 13:18 (1+04:23)
root tty1 Sat Jun 12 13:14 - down (00:02)
reboot system boot 2.6.18-128.el5 Sat Jun 12 13:12 (00:04)
root tty1 Sat Jun 12 12:56 - down (00:15)
reboot system boot 2.6.18-128.el5 Sat Jun 12 12:49 (00:22)
Script. started, file is mylove.txt
bash-3.2$ command1
bash: command1: command not found
bash-3.2$ command2
bash: command2: command not found
bash-3.2$ three
bash: three: command not found
bash-3.2$ commdn
bash: commdn: command not found
bash-3.2$ commdn
bash: commdn: command not found
bash-3.2$ last
root pts/0 192.168.19.168 Mon Jun 21 19:19 still logged in
root pts/0 192.168.19.168 Mon Jun 21 13:28 - 19:19 (05:50)
root pts/0 192.168.19.168 Mon Jun 21 10:43 - 11:40 (00:56)
reboot system boot 2.6.18-128.el5 Mon Jun 21 10:41 (08:45)
root pts/2 192.168.19.168 Fri Jun 18 11:30 - down (06:29)
root pts/1 192.168.19.160 Fri Jun 18 11:23 - 13:36 (02:12)
root pts/1 192.168.19.160 Fri Jun 18 11:22 - 11:22 (00:00)
root pts/1 192.168.19.160 Fri Jun 18 11:22 - 11:22 (00:00)
root pts/0 192.168.19.168 Fri Jun 18 09:41 - 11:46 (02:05)
reboot system boot 2.6.18-128.el5 Fri Jun 18 08:28 (09:31)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - crash (15:40)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - 16:47 (00:00)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - 16:47 (00:00)
root pts/1 192.168.19.168 Thu Jun 17 16:47 - 16:47 (00:00)
root pts/1 192.168.19.168 Thu Jun 17 16:39 - 16:47 (00:07)
root pts/0 192.168.19.168 Thu Jun 17 13:37 - crash (18:50)
reboot system boot 2.6.18-128.el5 Thu Jun 17 13:36 (1+04:22)
root tty1 Thu Jun 17 11:12 - down (00:00)
root pts/0 192.168.19.168 Thu Jun 17 09:39 - down (01:33)
reboot system boot 2.6.18-128.el5 Thu Jun 17 09:39 (01:33)
root pts/0 192.168.19.168 Thu Jun 17 09:31 - down (00:06)
reboot system boot 2.6.18-128.el5 Thu Jun 17 09:30 (00:07)
root pts/1 192.168.19.168 Thu Jun 17 09:21 - down (00:07)
root pts/0 192.168.19.168 Thu Jun 17 08:47 - down (00:41)
reboot system boot 2.6.18-128.el5 Thu Jun 17 08:30 (00:58)
root pts/1 192.168.19.160 Sun Jun 13 17:40 - 17:40 (00:00)
root pts/1 192.168.19.160 Sun Jun 13 15:09 - 16:55 (01:45)
root pts/0 192.168.19.168 Sun Jun 13 14:55 - down (02:46)
root pts/1 192.168.19.168 Sun Jun 13 11:48 - 14:40 (02:51)
root pts/2 192.168.19.160 Sun Jun 13 08:56 - 09:54 (00:57)
root pts/1 192.168.19.168 Sun Jun 13 08:27 - 09:54 (01:26)
root pts/0 192.168.19.168 Sun Jun 13 08:23 - 14:40 (06:16)
root pts/2 192.168.19.168 Sat Jun 12 18:05 - 21:58 (03:52)
root pts/1 192.168.19.168 Sat Jun 12 16:48 - 21:58 (05:09)
root pts/0 192.168.19.168 Sat Jun 12 16:45 - 21:58 (05:12)
root pts/0 192.168.19.168 Sat Jun 12 16:08 - 16:45 (00:37)
root tty1 Sat Jun 12 13:45 - down (1+03:55)
root tty1 Sat Jun 12 13:33 - 13:35 (00:02)
root tty1 Sat Jun 12 13:18 - 13:19 (00:00)
reboot system boot 2.6.18-128.el5 Sat Jun 12 13:18 (1+04:23)
root tty1 Sat Jun 12 13:14 - down (00:02)
reboot system boot 2.6.18-128.el5 Sat Jun 12 13:12 (00:04)
root tty1 Sat Jun 12 12:56 - down (00:15)
reboot system boot 2.6.18-128.el5 Sat Jun 12 12:49 (00:22)
wtmp begins Sat Jun 12 12:49:22 2010
bash-3.2$ exit #退出script命令記錄
exit
Script. done, file is mylove.txt
-bash-3.2$
bash-3.2$ exit #退出script命令記錄
exit
Script. done, file is mylove.txt
-bash-3.2$
以後工作,除了secure crt外,多了一種選擇了,有空再學習下如何回放這些記錄的命令檔案
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-665813/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- shell指令碼自動記錄登入使用者ip和歷史命令指令碼
- Linux下mysql的歷史操作記錄LinuxMySql
- Linux中禁用命令歷史記錄Linux
- 使用 JavaScript 操作瀏覽器歷史記錄 APIJavaScript瀏覽器API
- solaris下配置使用SQL*Plus歷史命令記錄SQL
- TcxMRUEdit 最近歷史記錄
- SqlServer查詢資料改動歷史記錄SQLServer
- git重寫歷史記錄Git
- Linux中多種方法實時記錄歷史命令Linux
- 取消root命令歷史記錄以增加安全性 (轉)
- win10 自帶播放器有歷史記錄嗎_windows10自帶的影片播放器怎麼檢視歷史記錄Win10播放器Windows
- SAP歷史更改記錄函式函式
- win10怎樣看歷史記錄_win10檢視歷史記錄的方法Win10
- win10 自帶播放器有歷史記錄嗎_windows10自帶的視訊播放器怎麼檢視歷史記錄Win10播放器Windows
- 7 個實用的操作 Bash 歷史記錄的快捷方式
- Shell歷史命令
- git log檢視提交歷史記錄Git
- 理解瀏覽器的歷史記錄瀏覽器
- 瀏覽器歷史記錄的返回瀏覽器
- EBS:銷售訂單歷史記錄
- linux 清空歷史執行記錄Linux
- Oracle中檢視sql命令歷史,檢視rman命令歷史OracleSQL
- win10怎麼清除更新歷史記錄 win10電腦如何清除更新歷史記錄Win10
- Saltstack自動化操作記錄(1)-環境部署
- Saltstack自動化操作記錄(2)-配置使用
- Git 學習記錄之演變歷史Git
- ClipboardManager for Mac(剪貼簿歷史記錄管理)Mac
- 清除 GitHub 歷史記錄的隱私資訊Github
- Linux檢視歷史記錄小技巧Linux
- 透過歷史記錄執行本地模型模型
- linux歷史命令Linux
- 記錄Linux操作命令Linux
- linux系統安全問題,如何清除你的cli操作歷史記錄Linux
- win10如何關閉工作列歷史記錄_win10工作列歷史記錄怎麼關閉Win10
- win10如何關閉活動歷史記錄_win10系統關閉活動歷史記錄的步驟Win10
- 修改Kali Linux終端歷史記錄大小Linux
- 清除“遠端桌面連線”的歷史記錄
- 理解瀏覽器歷史記錄(2)- hashchange、pushState瀏覽器