Showing posts with label history. Show all posts
Showing posts with label history. Show all posts

Friday, February 19, 2016

history on linux

การดู log ว่า user ที่ login เข้าไป ทำอะไรไว้บ้าง ปกติเราจะใช้คำสั่ง history ซึ่งมันก็จะแสดงรายการยาวพรีดออกมาเลย

#history

#history 100  --> แสดงออกมา 100 บรรทัน

ปรับแต่งให้รู้ว่าคำสั่งนั้น ๆ ใช้เมื่อไร ดังนี้

#vim .bashrc

HISTTIMEFORMAT="%Y%m%d %T  "  --> เพิ่มเข้าไปในบรรทัดสุดท้าย

#
เสร็จแล้ว restart 1 ครั้ง แล้วลองเรียกใช้คำสั่งอีกครั้ง

#
ทดสอบบน CentOS