hpcloud / tail

Go package for reading from continously updated files (tail -f)
MIT License
2.7k stars 502 forks source link

Can solve the problem of file scrolling in Linux? #186

Open hz-kelpie opened 2 years ago

hz-kelpie commented 2 years ago

like the file'/root/.bash_history'

when my '/root/.bash_history' start roll

root@kelpie-btf:~# wc -l /root/.bash_history 

2000 /root/.bash_history

root@kelpie-btf:~# echo $HISTSIZE

1000

this util work abnormal ,but "tail -f /root/.bash_history " can still work

this is my config

t, err := tail.TailFile(p, tail.Config{
    Location: &tail.SeekInfo{
        Offset: 0,
        Whence: io.SeekEnd,
    },
    ReOpen:      true,
    Follow:      true,
    Poll:        true,
    MustExist:   false,
    Pipe:        false,
    MaxLineSize: 10000
})