Skip to main content

Questions tagged [tail]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

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
8 votes
1 answer
976 views

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
  • 491
0 votes
1 answer
109 views

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
0 votes
1 answer
55 views

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
3 answers
356 views

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
16 votes
5 answers
13k views

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
1 vote
0 answers
37 views

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 votes
2 answers
88 views

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
3 votes
2 answers
551 views

I am modifying the text following tail -f. I have the following program that monitors a file: tail -vf -c5 /tmp/index \ | cat -n \ | ...
john-jones's user avatar
  • 1,766
1 vote
1 answer
85 views

tail -f a/b/c.log d/e/f.log logs like this: ==> a/b/c.log <== xxx yyy Exception happened 1 zzz ==> d/e/f.log <== rrr Exception happened 2 sss How to change command so that the lines ...
Mike Rapsen's user avatar
1 vote
2 answers
3k views

I have to grab the first two lines, the lines 43 and 44, and the last 2 lines from a file in one conduct of commands. Is there away to print those while only using head, tail and pipe commands AND ...
cow's user avatar
  • 81
0 votes
2 answers
315 views

I have two scripts emitting single string to log files periodically that I need to tail -f and combine side by side for which I am using paste. This works but I am unable to pipe the output to another ...
Ketan's user avatar
  • 9,446
0 votes
1 answer
908 views

I want to print only the last line of the output of a command on the same line continuously without clearing the screen. This would be part of another function. Let's say my script has the following ...
blue's user avatar
  • 1
0 votes
1 answer
202 views

Currently I do: while [ -d "/proc/$PID" ]; do sleep 1 done To wait for a process to exit. If I would replace it with: tail --pid=$PID -f /dev/null Would that be more efficient for the ...
Maestro's user avatar
  • 233
2 votes
6 answers
264 views

I often want to grep output from processes that include a few header lines. But if grep would remove all actual content lines, I don't want to display the header lines. For this to work I would need a ...
Colin 't Hart's user avatar
2 votes
4 answers
2k views

Assume two files with the following content: $ cat ttest1.txt x = 1 x = 3 y = 5 $ cat ttest2.txt x = 4 x = 10 y = 3 I would like to recursively grep the files for x and print the last instance in ...
mahmood's user avatar
  • 1,271
0 votes
1 answer
351 views

I have a "for" loop which passes the results to a file called "results" Occasionally an error stream is detected and the loop continues trying within the loop for a number of times ...
Leighton 's user avatar
12 votes
2 answers
2k views

I'm able to run this command successfully: tail -f my_file.txt | grep foo It shows only the lines with the string foo, and it keeps showing them. But when I run this command: tail -f my_file.txt | ...
Ram Rachum's user avatar
  • 1,905
1 vote
1 answer
181 views

I've got log files which get downloaded via cron job. If a file is updated on the remote location, the local copy gets rewritten from the beginning even if only data has been appended. Tools like tail ...
Axel Beckert's user avatar
0 votes
1 answer
127 views

In the terminal, if I don't want to have logs of a program wrap, I can pipe those to less -S. However, horizontal scroll with keyboard doesn't work unless I Ctrl+C, and after that, I don't know how to ...
doplumi's user avatar
  • 101
1 vote
0 answers
24 views

I need to monitor a log file which sometimes contains invalid UTF8 characters. Like this: shaozr@fedora utf8-cut (bear_from_3.1.18) $ tail -F a.txt a我々はMozartが好きです。 a我々はBachも好きです。 a▒▒▒々はMozartが好きです。 a▒...
grizzlybears's user avatar
3 votes
3 answers
310 views

I basically want to do this: tail -f trades.csv | csvtool readable - I want to read a CSV file in a readable format using csvtool and I want to keep watching it. I think that command doesn't work ...
SpaceMonkey's user avatar
1 vote
0 answers
20 views

I'd like to capture and filter the logs from my ESP32 peripheral from the serial port and generate a new log file with the selected line. I do as follows: $ (((stty speed 115200 && cat) </...
Stéphane de Luca's user avatar
1 vote
2 answers
64 views

Assuming the following dummy command in bash: ### dummy long_operation_cmd function, for easy reproduction: function long_operation_cmd() { echo "operation 1" sleep 5 echo "...
Lockszmith's user avatar
1 vote
3 answers
1k views

I have a file and I am running a tail command on this file like this tail -n+1 -F "./log/catalina.log" I want to suffix or prefix another string to each line coming out of this file, which ...
Shima Mahmoud's user avatar

1
2 3 4 5
9