I'm trying to combine less +F with a &pattern, but can't get it to work like I want:less +F'&foo|bar' file.logIt seems to ignore my pattern.
How to invoke less with a pattern
less
You need to run the filter command before the follow command, otherwise the filter command is never applied (pressing Ctrl+C to get out of follow mode cancels any pending input, including fake input injected via the command line).So in the + argument, you need to pass the &foo|bar command first, then the F command. To terminate the & command, you need a newline.less +$'&foo|bar\nF' file.log(Assuming your shell is ksh, bash or zsh, where $'\n' expands to a newline.)