- Recursive tailing for existing files and newly created files.
- Text-only detection to avoid binary noise.
- TUI with scrolling, follow mode, pause/resume, and clear.
- Optional include/exclude glob filters.
cd /Users/zongbaolu/work/folder_tail
go build ./cmd/ft./ft [root] [pattern ...]root must be an existing directory (default is the current working directory). If the first argument is a directory, it is treated as the root; remaining args are patterns.
make test
make build
make run-nnumber of last lines to show on startup per file (default10,0= start at end)-from-startshow full contents for existing files from the beginning-scan-intervalperiodic rescan interval (default5s,0disables)-absoluteshow absolute paths-includeinclude glob list (comma-separated; matches file name or relative path)-excludeexclude glob list (comma-separated; matches file name or relative path)-buffermaximum number of lines kept in the TUI buffer (default10000)-max-line-bytesmaximum bytes per line before truncation (default1048576)-versionprint version and exit-re/-regextreat patterns as regular expressions-r/-Rrecursive (default true; set-r=falseto disable)
- Default behavior is recursive;
ft ./*.logis equivalent toft -r ./*.log. - Patterns are globs by default. Patterns with
/(or OS separators) match the relative path; otherwise they match the file name. - Leading
./or.\\is stripped for glob patterns (so./*.logbehaves like*.log). - To avoid shell expansion, wrap patterns in quotes (for example:
ft '.' '*.log'). - Regex mode: use
-re/-regexor prefix a pattern withre:(for example:ft -re '.*\\.log$'orft 're:.*\\.log$').
ft .
ft ./*.log
ft /var/log '*.log'
ft /var/log -exclude '*.gz'
ft -re /var/log '.*(err|warn).*\\.log$'folder-tailis an alias binary that runs the same CLI asft.
q/ctrl+cquitspacepause/resume (still collects new lines)ftoggle follow mode (Follow auto-jumps to newest lines; Free keeps your scroll position)cclear bufferptoggle path display (grouped header vs inline)- arrows / page up/down /
[]scroll
- Lines are shown as
path: line. - If a line is still being written (no trailing newline), it is shown with
...and updated when completed. - Periodic rescans also pull in missed writes if filesystem events were dropped.
- Periodic rescans remove deleted files/directories from the watch set if events were missed.
- Text detection accepts UTF-8 and other non-binary encodings without NUL bytes and rejects common binary signatures/content types.
- When no patterns are provided, common binary extensions (e.g., .wav, .bin, .aiff) are skipped.