Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tail]

Watching updates at the end of a file, with or without the tail utility

8
votes
3answers
18k views

Suppress 'file truncated' messages when using tail

I'm tailing a log file using tail -f messages.log and this is part of the output: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget tellus sit amet odio porttitor rhoncus. Donec ...
4
votes
0answers
237 views

Combing head and tail in a single call via pipe [duplicate]

On a regular basis, I am piping the output of some program to either head or tail. Now, suppose that I want to see the first AND last 10 lines of piped output, such that I could do something like ./...
3
votes
1answer
168 views

Why are some file changes not shown in tail -f?

I tried to follow the mysql history file with: tail -f ~/.mysql_history in another window I entered as the same user: mysql -u someotheruser -p and none of the following commands are shown in my ...
3
votes
2answers
4k views

Using tail to follow daily log file in Bash

I have a task to use a bash script to monitor a couple of log files named with the current day, eg. YYYY-MM-DD.log. (1) I used tail -f to follow the file but unable to deal file rotation. Even if ...
2
votes
1answer
8k views

how do i redirect output from tailf & grep to a file [duplicate]

All I wanted is to grep for specific lines in an ongoing log and re-direct it to some file.. tailf log | grep "some words" Now, I want the above command output to get re-directed to some file in on-...
1
vote
1answer
35 views

How to cat named pipe without waiting

If there is nothing in a named pipe and I do: cat my_named_pipe it will wait until data arrives. Is there a flag I can use to exit immediately if there is no data to be read? Or perhaps a command ...
1
vote
0answers
86 views

tail -F is not working with while and case statement [closed]

I want to monitor the logs continously and echo the output if keyword appears then continues the monitoring!! My question is how to perform the below operation Tail the logs. If keyword[down] ...
1
vote
0answers
108 views

Why does GNU head/tail read the whole file? [duplicate]

I have a huge file and want to see its beginning and end. However, when I use head and tail, it apparently tries to read the whole file. Since the file is larger than a terabyte, this takes a very ...
0
votes
1answer
43 views

Too many emails sent when sending emails when specific URL has been visited in Apache Logs

In this question, a solution was found to automatically send an email each time a specific URL is visited (such as ?src=foo), as seen in the Apache logs: tail -F -n0 /var/log/apache2/...