Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
gitaarik
· 11y ago · 0 comments
It's a nice feature of less, but less is a pager, so you can't pipe the result to `grep` or `sed` or `awk` or something.
Comments
[–]
nilkn
11y ago
I'd wager that 90% of the time that I'm using 'tail -F' I'm also piping it to grep.
[–]
jfroma
11y ago
This. I use:
tail -f /var/log/x.log | grep foo -A 20 -B 20
Most of the time.
[–]
gitaarik
OP
11y ago
You know you can also do -C 40 for 40 lines of context instead of -A 20 -B 20
[–]
nkouevda
11y ago
Note that -C is in each direction, not total; -C20 is equivalent to -A20 -B20.
[–]
mattikus
11y ago
While you may not be able to do transforms on the output via `sed` or `awk`, you can get a grep-like filtering by using the `&` character with `less` open.