Xóa bài viết
Bạn có chắc chắn muốn xóa bài viết này không ?
Another way to read log files
watch -n 1 tail test.log
- Log file is too big in some cases, opening with vim will cause high ram usage
- Want to analyze real-time logs, it means you need to read something new in the end of it, and real-time. Right?
- No need to read the beginning of this.
- In general, we use
tailf [option] <file> Follow the growth of a log file. Options: -n, --lines <number> output the last <number> lines -<number> same as '-n <number>' -h, --help display this help and exit -V, --version output version information and exit For more details see tailf(1). Warning: use of 'tailf' is deprecated, use 'tail -f' instead.
- But we should use both
tailcommand for better display and we can handle interval, seconds to wait between updates
$ watch -n 1 tail test.log ----- Every 1.0s: tail test.log </script> </body> </html> hello-test color color again
Check RAM usage with
$ devops@snode:/proc$ watch -n 1 head meminfo Every 1.0s: head meminfo MemTotal: 1012720 kB MemFree: 415876 kB MemAvailable: 847124 kB Buffers: 29064 kB Cached: 445560 kB SwapCached: 0 kB Active: 237192 kB Inactive: 259380 kB Active(anon): 26888 kB Inactive(anon): 47504 kB
Cùng một tác giả
Bài viết liên quan