Questions tagged [tail]

Output the last part of files.

Output the last part of files, print the last part (10 lines by default) of each FILE; tail reads from standard input if no files are given or when given a FILE of `-'.

Manpage

94 questions
106
votes
11 answers

How to display certain lines from a text file in Linux?

I guess everyone knows the useful Linux cmd line utilities head and tail. head allows you to print the first X lines of a file, tail does the same but prints the end of the file. What is a good command to print the middle of a file? something like…
Boaz
  • 2,159
  • 5
  • 19
  • 15
50
votes
11 answers

Tail multiple remote files

Is there a way to remote tail 2 files? I have two servers(a and b) behind a load balancer and I would like to do something like this if possible: tail -f admin@serverA:~/mylogs/log admin@serverB:~/mylogs/log Thanks!
Pablo Fernandez
  • 645
  • 1
  • 5
  • 8
39
votes
4 answers

In tail -f, how do I filter out stuff that has certain keywords?

I want to tail -f my logs. However, I want to filter out everything that has the words: "ELB", "Pingdom", "Health"
Alex
  • 8,111
  • 24
  • 71
  • 99
38
votes
8 answers

Colorize Monitoring of Logs

I sometimes monitor apache and php error logs using tail under FreeBSD. Is there any way to get colorized output, either using tail or some other command line app? Alternatively, what is your favorite way to monitor the various web-related logs in…
Ian
  • 1,488
  • 4
  • 26
  • 32
30
votes
10 answers

Convenient Windows equivalent to tail -f logfile?

Is there some convenient alternative to this on Windows? I always miss this away from Linux. And no I don't consider Cygwin or some other bash port to be "convenient". :) Either a small app that'll do it from the command line or will have it open in…
cletus
  • 9,779
  • 9
  • 36
  • 40
23
votes
7 answers

Continuously monitor logs with tail that are occasionally rotated

We're using tail to continuously monitor several logs, but when a log is rotated the tail for that file will cease. As far as I understand, the problem is that when the log is rotated, there is a new file created, and the running tail process…
xkcd150
  • 908
  • 1
  • 7
  • 11
15
votes
2 answers

Bash Prompt Below Output - Background Log Tail

I used to work for a company who had a customised shell for management of one of their products that was running on Linux and I'm looking to replicate a key feature of this shell. All the work was done by a background process and the output from the…
iamacarpet
  • 310
  • 2
  • 12
14
votes
4 answers

`tail -f` sometimes stops updating - and the file hasn't moved

I have noticed recently that sometimes tail -f will stop updating to the screen. Doing a Ctrl>-C and restarting the tail works fine, though. And I checked to make sure the logfile isn't being rotated midstream (which can make tail lose…
warren
  • 17,829
  • 23
  • 82
  • 134
12
votes
4 answers

How to watch for count of new lines in tail

I want to do something like this: watch tail -f | wc -l #=> 43 #=> 56 #=> 61 #=> 44 #=> ... It counts new lines of tail each second / Linux, CentOs To be more clear. I have got something like this: tail -f /var/log/my_process/*.log | grep error I…
fl00r
  • 565
  • 2
  • 6
  • 20
11
votes
4 answers

Is is possible to filter the output of tail?

I'd like to tail a file but only output lines that have a certain string in them. Is this possible?
Abe Miessler
  • 905
  • 4
  • 11
  • 20
10
votes
9 answers

Colour tail of Apache logs

Monitoring apache logs with tail –f tends gets very frustrating for the eyes after a while. Are there any tool/options to colorize the log outputs? Maybe signal FATAL with red, etc...
Cherian
  • 791
  • 1
  • 6
  • 13
9
votes
5 answers

Adding tail behaviour where enter adds blank lines to less

I love less, which I can use to follow logs with the +F flag (or the ShiftF hotkey), search forwards and backwards, and generally move freely through the document. But there is one thing missing in less: usually I am at the end of the file, and I…
blueFast
  • 4,000
  • 13
  • 36
  • 51
8
votes
2 answers

tail -f not following log file in Docker container

I am seeing some strange behavior running the tail -f command inside a Docker container in CoreOS. There are a number of variables I can think of that may be contributing to the problem but I am not sure what I need to do to troubleshoot first. On…
jmreicha
  • 791
  • 1
  • 16
  • 29
8
votes
6 answers

Tail -f on new files

Is there a way to do something like this: tail -f logs/ and make the stdout to be updated on every line added to each file already present in logs/ and to every file that will be created in logs/ after the command is issued?
Jack
  • 485
  • 1
  • 4
  • 12
8
votes
2 answers

Use local tools to monitor remote logs

I don't have root access on my hosted web server, but I would like to use tools like MultiTail to monitor log files that are generated on my web host. Is there a way I can pipe the log output on my remote host ( I have ssh access ), to my locally…
Ian
  • 1,488
  • 4
  • 26
  • 32
1
2 3 4 5 6 7