The command less
can be used to replace tail
in
tail -f file
to provide features like handling binary output and navigating the scrollback:
less +F file
The +
prefix means "pretend I type that after startup", and the key F
starts following.
But can less
also replace
tail --follow=name file
which follows file
even if the actual file gets deleted or moved away, like a log file that is moved to file.log.1
, and then a new file is created with the same name as the followed file?
less --follow-name
orless --follow-name +F
less --follow-name +F
is it - no idea how I missed that - I was pretty sure I searched the man page forfollow
... strange. Make it an answer!--follow-name
is described, but+F
is never mentioned, and I think it's pretty important because it's not widely known obviously.less follow
, READ THE QUESTION. It already answers how to makeless
follow file changes!