Is there a Linux command similar to tail where instead of specifying a number of lines you can specify a string of text, the file would be searched for that text from the last line to the first and then display all or a specified number lines after that? The content at the end of the log I'm trying to capture can vary between 0 and 10 lines so when it isn't 10 it makes the log file that I copy it to hard to understand.
From the tail man page I'm only seeing the ability to specify either lines or bytes.
Best Answer
Here's some fake data to play with:
...and here I'm searching for the string "90" and displaying everything after it (until the
$
end of the file):If you want a more flexible solution, use a variable, change the sed quotes (and escape the
$
from the shell, for sed):