I want to say output lines 5 - 10 of a file, as arguments passed in.
How could I use head and tail to do this?
where firstline = $2 and lastline = $3 and filename = $1.
Running it should look like this:
./lines.sh filename firstline …
How to make tail display only the lines that have a specific text? If the search criteria can be a regular expression, it would be even better. I need something like:
tail -f mylogfile.log showOnlyLinesWith "error: "
I am running …
Going with a typical Apache access log, you can run:
tail -f access_log | grep "127.0.0.1"
Which will only show you the logs (as they are created) for the specified IP address.
But why does this fail when you pipe it …