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
38 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
0 votes
2 answers
91 views

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
  • 847
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
14 votes
1 answer
748 views

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
118 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
14 votes
1 answer
679 views

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
56 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
1 answer
253 views

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
367 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
0 votes
0 answers
639 views

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

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
324 views

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
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 vote
1 answer
703 views

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

I can do tail -vf -c5 thefile \ | cat -n \ | sed -E 's/a/b/g' \ ; But the following gives no output. tail -vf -c5 thefile \ | cat -n \ | sed -E '...
john-jones's user avatar
  • 1,766
3 votes
2 answers
555 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
1k views

I need to use the tail ... --pid=PID option in my docker container that is based on Alpine image in order to I can kill the running background tail process automatically. Unfortunately the BusyBox ...
zappee's user avatar
  • 333
1 vote
1 answer
86 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
0 votes
2 answers
785 views

Hello I would like to know if there is a way where I can only use head, tail, and pipes (and redirection eventually) to extract and output the start, middle characters, and end of a string Example: ...
naynay's user avatar
  • 17
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
4 answers
433 views

The ways that I've thought of: If you get to reproduce the scenario in real time. Use tail -f application.log | tee /tmp/tailed_log But it's not sure that we'll get to reproduce the scenario in real ...
achhainsan's user avatar
0 votes
2 answers
322 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
3 votes
1 answer
169 views

Is it possible to save the output of earlier tailed logs to a file? Steps to Reproduce this issue: tail -f application.log Ctrl+C to end the logs Save that output to a file now. I am assuming an ...
achhainsan's user avatar
0 votes
1 answer
918 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
1 vote
1 answer
1k views

I'm trying to come up with a script for managing jobs on a supercomputer. The details don't matter much, but a key point is that the script starts to tail -f a file once it appears. Now this would run ...
Neinstein's user avatar
  • 286
0 votes
1 answer
207 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
1 vote
1 answer
182 views

In my app I use tail -q -f -n +1 [file name] to read current data of a file (dynamically growing file) and continue reading new chunks until the end. But that command never exits. It stays alive in ...
james hofer's user avatar
2 votes
6 answers
272 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
1 vote
0 answers
92 views

Context I have a GitHub Action running on a linux machine. It does the following (might want to skip to problem first as most of this might be irrelevant): pwd: /home/runner/work/net.twisterrob....
TWiStErRob'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
63 views

I have tomcat catalina.log file that keeps getting updated. I wish to maintain its past 500 lines + any appended logs into a new file catalina.log_new for the next 2 hours. To start off I run nohup ...
Ashar's user avatar
  • 527
0 votes
1 answer
354 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
0 votes
1 answer
350 views

Lately I needed to be able to run a script in the background and monitor its output from another machine. For this reason I was able to use this command: $ nohup ./rsync.sh > ./output.txt This is ...
Martin Zeltin'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
2 votes
1 answer
136 views

I have an app which dumps a lot of log messages. I want to catch a middle of that log, which happens as a reaction to an event. Tried this: tmpfile=`mktemp` tail -n1 -f appA_log_file.txt >> $...
White Owl's user avatar
  • 5,297
1 vote
1 answer
189 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
2 votes
1 answer
770 views

I am trying to execute tail -100000f MXMLExchangeMonitoring_Mx3.log | egrep "INTENTO.*Workflow" | cut -d ":" -f "3" | cut -c 3,4,5,6 | awk '{if($1>20)print$1}' and I'...
Aurelio Alexander Hernández'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
0 votes
0 answers
193 views

I'm trying to write a command that exits cleanly when a specific string is eventually written to a log file. I've tried the following but it never exits. Setup: create a file for the purposes of ...
Jeremy Danyow's user avatar
1 vote
0 answers
25 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
1 vote
1 answer
1k views

Running on Red Hat EL7, we have these great long lines in our log files so I do a tail -f Log | cut -c1-$COLUMNS This works great on some systems but other--apparently identical--systems, the pipe ...
user1683793's user avatar
3 votes
3 answers
313 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
2 votes
3 answers
2k views

I am trying to make it easy to tail a log file and print to the screen only the output of a single field. I have the log file that looks like this on a Linux machine: 2022-10-21 16:00:08;areq_in=0;...
Priti Patel'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
0 votes
2 answers
125 views

I would like to see the logs for a microservice with the latest version and send its content to a file according to the date. user@MacBook-Pro ~ % kubectl -n bci-api get pods | grep ms-example-...
joseluisbz's user avatar
1 vote
2 answers
65 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
1 answer
200 views

I'm running a daemon that process files in a specific dir. I want to process those one by one. so idea is I will copy files 1 by 1 in daemon dir, and tail its log, 2nd file should be copied to daemon ...
Sollosa's user avatar
  • 2,009
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
0 votes
0 answers
246 views

I am trying to record a reoccurring test to a txt file using tail but there is an issue with the output. The commands I am running are: script -q /dev/stdout -c 'scp /home/user/test.img user@pc28:/tmp'...
noob's user avatar
  • 1

1
2 3 4 5
9