Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Then why would you use tail instead idk, cat? Tail is really just to show the end of the file.
-
@gathurian i'm using tail to follow the whole thing live. cat would do the job, too, but how to view a concatenated output of all the .log, .log.1,2,3,... and .log.gz, .log.gz.1,2,3,... files?
-
Haven't used it, but heard of multitail.
If your problem is more like following the files through log rotation consider just using '-F' option. -
@nitwhiz If you want to follow it, why would you want to see the wgole damn file? Do I understand rhis correctly that you want a live updated log on the standard output/terminal? Like tail -f but instead of the last 20 lines it's the whole file?
-
@gathurian you can tell tail to output the whole file before following, you know that?
I want the whole log ever happened. Through log rotation you get a few log files and a few gz ones. I hoped for an easy way to actually read these 4 different kinds of file name patterns in one go, ordered by their timestamps.
@phorkyas gotta look into that. -
Srsly, whats the point to dump all the history to stdout if you only need to tail? It's not like you're gonna read those first 180mln lines...
-
@Commodore did that to print the whole file.
@netikras i want to grep the whole apache access log for something specific. After 2 weeks of runtime and low access counts that's actually not much in those files, the grepped result is going to be a few lines. -
@nitwhiz
grep != tail
zegrep -RHn "my_pattern" rotated_logs.gz*
egrep -RHn "my_pattern" live_logs*
sometimes zegrep recognizes non-gzipped files as well -
@netikras i piped tail into grep. So i can see live results, grepped.
Thanks for your answer though.
Related Rants
How the fuck do you actually tail log files?
Like i want the whole log. Not only from today, not *.log.1 and *.log, i want to run the *whole* log ever done, even the gzipped shit, through tail | grep.
rant
grep
unix
files
tail
logs