Skip to main content

Questions tagged [tail]

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

0 votes
0 answers
37 views

Is there anything like `tail -f` but that can follow multiple files and show which file each line came from? [duplicate]

I'm trying to monitor multiple log files simultaneously, but when I use: tail -f /var/log/app1.log /var/log/app2.log I get mixed output and can't easily tell which file each line originated from. What ...
Alphin Thomas's user avatar
0 votes
2 answers
81 views

Never exit "less +F" if the tailed file disappears?

Under ubunu 22.04, I'm using the standard less pager. When running less +F against a log file, I never want less +F to automatically exit if the log file disappears. Instead, I want the current view ...
HippoMan's user avatar
  • 807
8 votes
1 answer
976 views

What is the `-0` flag in `tail`? [duplicate]

The Logstash documentation said about the input file plugin that it Stream events from files, normally by tailing them in a manner similar to tail -0F but optionally reading them from the beginning. ...
glacier's user avatar
  • 489
14 votes
1 answer
740 views

Why does `tail -c 4097 /dev/zero` exit immediately instead of blocking?

I observe that, on Ubuntu 24.04.2 with coreutils version 9.4-3ubuntu6, running: $ tail -c 4097 /dev/zero $ echo $? 0 exits immediately with a status code of 0. I expected the command to block ...
Isidro Arias's user avatar
0 votes
1 answer
103 views

Does "less" have "--retry" option like "tail"?

I'm using less to continuously trace Squid log file (as well as UFW log) with this command: less --follow-name -K +F /var/log/squid/access.log And at the time of rotation of Squid log less quits. I ...
EliiO's user avatar
  • 3
14 votes
1 answer
672 views

"Tail -f" on symlink that points to a file on another drive has interval stops, but not when tailing the original file

I'm encountering a strange behaviour with tail -f, when tailing a symlink on an Ubuntu machine. Apparently, tail uses the default update interval of 1 second. If tailing the original file, it seems to ...
Whiskeyjack1101's user avatar
0 votes
1 answer
55 views

Run a few identical process and then kill one of them

Problem: Need to run several process, especially it will be “tail -f log.log >> wrile_log.log” proces to collect log. Commands can be run at the different time for same log file. This is not ...
Alex Alex's user avatar
1 vote
1 answer
237 views

How to know when a following tail moves from old file to the new one

So, I am working with tail -F ( or tail --follow=filename). Now it works as advertised and when a rollover occurs it will move to the new file. This is great and helps me keep track of my logs. The ...
user607688's user avatar
1 vote
3 answers
351 views

How to tail continuously a log file that is being deleted and recreated?

I need to extract information from a log file that is deleted and recreated every time a program runs. After detecting that the file exists (again), I would like to tail it for a certain regexp. The ...
user2066480's user avatar
0 votes
0 answers
596 views

How can I save the output of tail to my clipboard or somewhere on a SSH session where there is only a unidirectional connection and server is limited?

I have to report some logs from some of the servers in our infrastructure which I have limited permissions on. Every time I copy 1000 lines of logs and paste it into Slack, I can't do scp from the ...
Ilgar's user avatar
  • 3
16 votes
5 answers
13k views

How do I read the last lines of a huge log file?

I have a log of 55GB in size. I tried: cat logfile.log | tail But this approach takes a lot of time. Is there any way to read huge files faster or any other approach?
Yi Qiang Ji's user avatar
0 votes
0 answers
314 views

Can't clear / scroll-back buffer when using tail -f alacritty?

When I use tail with the -f option, I can not find anyway to clear the screen. It just shows a ^L. Same problem when following live logs with docker. While I'm just in the shell, the cmd-k works fine. ...
Roger's user avatar
  • 123
1 vote
0 answers
36 views

pfSense (FreeBSD) - tail -f not showing entire log when filtering with cut or sed [duplicate]

I have a strange problem when trying to display logs on pfSense (and I can reproduce the same problem on Ubuntu server also). The problem is this (with examples): I'm trying to display a running dhcp ...
Artur Meinild's user avatar
1 vote
1 answer
666 views

How to tail -f multiple files and grep each file individually in single output?

I have several log files (related to my webserver aka various error_log, access_log, etc.) that I want to monitor in real time, ie to see recent updates AND I need to filter each file individually ...
ino's user avatar
  • 357
-1 votes
2 answers
87 views

Linux "watch" command showing last 30 lines of nft list ruleset [duplicate]

I want to constantly see last 30 lines of code "nfc list ruleset" in Debian Bash. Something like this: watch -n 1 nft list ruleset | tail -n 30 But above code doesn't show last 30 lines of &...
gio's user avatar
  • 19

15 30 50 per page
1
2 3 4 5
29