Linux : command view Log Files - Looking at log files to help with debugging.
200910 Jun
Log Files - Looking at log files to help with debugging.
ด้วยความน่าเบื่อๆ ของ Linux เวลาเราจะดู Log ไฟล์เวลาเรา Run อะไรแล้วต้องการ debug ค่าออกมา ดังนั้นจึงจำเป็นต้องใช้ command linux มาช่วยด้วยคำสั่ง tail -f ก้อเลยรวบรวมคำสั่งไว้ใช้ยามจำเป็น
tail -f [fileName].log
To tail a log file with details specific to a certain IP address (e.g. 111.222.333.444):
tail -f [fileName].log | grep '111.222.333.444'
You can specify details other than the IP address.
To generate a new file that shows logs for your activities only (see below - Redirecting a command line's output to a file):
tail -f [fileName].log| grep ''|[yourUserID]|'' > [fileName].log
To tail a log file with details specific to a certain IP address (e.g. 111.222.333.444):
tail -f [fileName].log | grep '111.222.333.444'
You can specify details other than the IP address.
To generate a new file that shows logs for your activities only (see below - Redirecting a command line's output to a file):
tail -f [fileName].log| grep ''|[yourUserID]|'' > [fileName].log




