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

learn more… | top users | synonyms

3
votes
1answer
136 views

grep not working in a for loop over a list

I have some log files. And I have a list of user ids. My log files are in a particular format log-yyyy-mm-dd e.g. log-2014-09-30 I am trying to search each userId in the log file. This is what I am ...
4
votes
3answers
56 views

Time required to do pipe output to head/tail [duplicate]

There are lots of txt files in a directory. If I do time wc -l *.txt | head it takes real 0m0.032s user 0m0.020s sys 0m0.008s If I do time wc -l *.txt | tail it takes real 0m0.156s ...
5
votes
1answer
86 views

Tail log file on multiple machines over ssh

I'm trying to tail a log file on multiple remote machines and forward the output to my local workstation. I want connections to close when pressing Ctrl-C. At the moment I have the following function ...
4
votes
3answers
309 views

Open a directory and let it update itself using “tail -f”

Similar to my last question: Open a text file and let it update itself; is there a way I could do the same but for a folder instead? As I have a log folder, can I use tail -f with a folder? i.e. $ ...
2
votes
2answers
43 views

cygwin, tail -F and rapidly filling/rotatinglogs

I'm using cygwin tail to follow busy java web application logs, on a windows server, generating roughly 16Gb worth of logs a day. I"m constrained to 10MB log sizes, so the files roll very often. ...
26
votes
4answers
2k views

Why does “tail -f … | tail” fail to produce any output?

Why does the following command not produce any output? $ tail -f /etc/passwd | tail After reading about buffering, I tried the following to no avail: $ tail -f /etc/passwd | stdbuf -oL tail Note ...
9
votes
3answers
839 views

Open a text file and let it update itself

How can I open a text file and let it update itself? Similar to the way top works. I want to open a log file and watch it update itself on the fly. I have just tried: $ tail error.log But just ...
2
votes
4answers
278 views

Only cat from specific line X (with a pattern) to other specific line Y (with a pattern)

A little extended problem from "cat line x to line y on a huge file": I have a huge file (2-3 GB). I'd like to cat/print only from the line having "foo:" to the line having "goo:". Assume that "foo:" ...
1
vote
3answers
82 views

Pulling lines n to m from list of files found

Ultimately I need to grab lines 3-53 from ever csv in each subdirectory. I grabbed the lines like so (cat isn't necessarily required): cat /[path]/[file].csv | head -53 | tail -51 And the files ...
3
votes
1answer
172 views

“tail -f” show old file after file has been rotated [duplicate]

I have a script running continuously, reading tail -f /var/log/daemon.log The problem is, when the file /var/log/daemon.log gets rotated by logrotate, tail still has "file handle" for the old ...
18
votes
2answers
1k views

Coloring different sources for tail

I'm watching different logs by tail -q -f /var/log/syslog -f /var/log/fail2ban.log -f /var/log/nginx/error.log How can I have the output of each log colored differently?
5
votes
3answers
117 views

How to tail multiple files using tail -0f in Linux/AIX

I tried tailing two files using the option: tail -0f file1.log -0f file2.log In Linux I see an error "tail : can process only one file at a time". In AIX I see the error as "Invalid options". ...
8
votes
0answers
271 views

scroll through output using `less` or `tail -f` while keeping the header visible [duplicate]

I am trying to scroll through some data formatted thus- NFI T[PSEC] T[K] EKIN(PSI) E(RHO) ECONS ANNEE ANNER !> 1 0.00012 0 0.45873 16.26904 16.72777 ...
5
votes
1answer
69 views

Not able to see the progression of a file with “tail -f”!

It's a surprise why now this command isn't working which earlier was. See I've the below command to run for backup. ubuntu@ubuntu:~$ sudo tar -cvf /media/ubuntu/My*Linux/ub*data/zebra.tar ...
4
votes
1answer
63 views

tail -f produces no output in Ubuntu live CD

For some test I start Ubuntu Live from USB. I'm trying to use tail command to show debug log, but it doesn't work. I also test opening two terminals (t1, t2) with this code: t1: touch a t2: ...
3
votes
1answer
92 views

Grep with spaces suddenly doesn't work

When performing a grep like: $ tail -f apilog_2014.07.09.log | grep "HELLO" | grep "99999" I get the desired output: 12:22:35 server apache2: HELLO FRIEND 99999 12:22:35 server apache2: HELLO ...
2
votes
1answer
76 views

multitail - custom config (multitail.conf) location

Is it possible to provide a custom location for multitail.conf - or are my only options /etc/multiltail.conf or ~/multitail.conf? I'd like to provide a specific config file that has regexes specific ...
2
votes
3answers
72 views

What does “tail -f ” do? [duplicate]

I don't understand the function of the option -f added to the tail command. I know that tail views the "last" part of a file. The manual says that -f outputs appended data as the file grows But ...
14
votes
2answers
1k views

How do I “cat and follow” a file?

A file is being sequentially downloaded by wget. If I start unpacking it with cat myfile.tar.bz2 | tar -xj, it may unpack correctly or fail with "Unexpected EOF", depending on what is faster. How to ...
1
vote
1answer
43 views

How to echo from specific line of a file to another specific line [duplicate]

Assume I have a file with about 10000 lines. How can I print 100 lines, starting from line 1200 to line 1300?
2
votes
2answers
538 views

continuous reading from named pipe (cat or tail -f)

I have configured rsyslog to log certain log events to /dev/xconsole: *.*;cron.!=info;mail.!=info |/dev/xconsole /dev/xconsole is a named pipe (fifo). If I want to see what is being logged, I ...
4
votes
4answers
423 views

How to get lines 10 to 100 from a 200 line file into a new file [duplicate]

I have file with 200 lines. I need to extract lines from 10 to 100 and put them into a new file. How do you do this in unix/Linux? What are the possible commands you could use?
1
vote
2answers
81 views

Temporarily freeze a process upon shell interaction

Let's say on a single console I have tail -F running, showing the output of many log files in realtime. Sometimes I need to run commands there too, however, and examine their output briefly, without ...
3
votes
2answers
49 views

tail display whole file and then only changes [duplicate]

My Linux version is 2.6.32-47-server (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1) ) #109-Ubuntu SMP Tue May 7 02:17:05 UTC 2013 I am currently doing a tail -f file and life is good. But that only ...
0
votes
1answer
60 views

Is it possible to `tail -f /dev/vcs`?

I would like to get a continuous stream of output from the virtual terminal. Is that possible? If not, why is tail -f not working here?
5
votes
3answers
362 views

tail -f, Determine if a file is no longer being written to [closed]

I am using tail -f to follow the growth of a log file. I am having trouble finding a way to detect if the process that is writing to the log file (when it crashes or is otherwise terminated) is no ...
4
votes
2answers
575 views

What does tail -f <directory name> do?

I mistakenly executed the following command in the terminal: tail -f /logs/applications/logs* I got the following output: tail: file shrunk! Error 0 I am not sure what exactly happened. I have ...
2
votes
2answers
213 views

What does tail -0a do?

In the documentation for logstash, they mention the command tail -0a I have never heard of the -a flag and I can't find any information on google, tail --help or the man pages. What is the ...
1
vote
1answer
218 views

Convert newlines to null-delimited when using tail

How can I change the output from tail to use null-terminated lines instead of newlines? My question is similar to this one: How to do `head` and `tail` on null-delimited input in bash?, but differs ...
24
votes
1answer
848 views

Do I need to worry about “tail: unrecognized file system type 0xbeefdead”?

I'm trying to follow a regular text file with tail -f -n 50 filename. I get the information from the file just fine, except I always get this error message: tail: unrecognized file system type ...
0
votes
3answers
81 views

Is it possible to change the default COUNT value of tail and head?

The less command accepts its defaults with an environment variable LESS, so you can export LESS='-F -g -i -M -R -S -w -X -z-4' at the beginning of your session. Is it possible to change the ...
1
vote
2answers
380 views

will tail with piping read whole file?

I want to read a big log file with 10000 lines everytime. and I use this command: tail -c +offset somefile | head -n 10000 my question is, with the piping of head, will tail read the whole file? ...
1
vote
1answer
356 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 ...
0
votes
1answer
68 views

Need to grep for specific lines from ongoing log and save it in some file

So, let me start with the overall outcome that i want to achieve. There is just one log, which will have info on certain devices, that i am upgrading. I use "tailf log" to monitor the log. Now, ...
9
votes
4answers
3k views

Grep from the end of a file to the beginning

I have a file with about 30.000.000 lines (Radius Accounting) and I need to find the last match of a given pattern. The command: tac accounting.log | grep $pattern gives what I need, but it's too ...
4
votes
2answers
48 views

Can less load lines which were appended to a file after opening?

When I am viewing a log file in less is it possible to make less reload the file to get lines which were appended to that file since it was opened?
0
votes
1answer
65 views

Stop tailing log

I have a problem, I accidentally did tail -f on a log, but now I cant quit! - Its the anaconda log during a redhat install. Control-C doesn't seem to work, I guess due to it saying sh: no job control ...
2
votes
1answer
200 views

Piping periodic data between Python scripts

How to receive data from the environment e.g. bash I am trying to launch two Python scripts in bash and pipe stdout from one of them to stdin of the other. The first script outputs a single ...
0
votes
2answers
394 views

Tail multiple files and output as additional column with 'find' results

Would like to pull the last line of text from a specific (multiple) files in a directory. Additionally, I'd like the results to be in a more traditional column format (like ls) with path, rather than ...
2
votes
3answers
361 views

How to tail a file over the network?

How can I tail -f a file that over the network, say at \\192.168.2.130\public\print.log? I have tried the variations of the following: tail -f //192.168.2.130/Southpaw/Tactic/print.log which erred ...
3
votes
2answers
132 views

How can I monitor a file that fully recreates during its run?

This is a follow-up question of Why are some file changes not shown in tail -f? With the use of capital F: tail -F I can monitor the output of tail -F ~/.mysql_history from the manual: ...
3
votes
1answer
103 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 ...
5
votes
2answers
219 views

Show tail of files in a directory?

I have a directory that is too huge to browse by any means. Grepping returns argument lists too long, WINSCP crashes when trying to open the directory. Is there a way I can view just the last 200 ...
74
votes
3answers
3k views

Does tail read the whole file?

If I want to tail a 25 GB textfile, does the tail command read the whole file? Since a file might be scattered on a disk I imagine it has to, but I do not understand such internals well.
4
votes
1answer
163 views

How can I colorize head, tail and less, same as I've done with cat?

I've got 'color cat' working nicely, thanks to others (see How can i colorize cat output including unknown filetypes in b&w?). In my .bashrc: cdc() { for fn in "$@"; do source-highlight ...
1
vote
1answer
47 views

Get last changed content since last read

How can I get the last changed content of a file, since its last read? Something more precise that this: tail - <nr >file_1.txt >file_2.txt where file_2.txt gets the last modified ...
2
votes
1answer
802 views

Search and Filter Text on large log files

I use the tail, head and grep commands to search log files. Most of the time the combination of these 3 commands, in addition to using pipe, gets the job done. However, I have this one log that many ...
1
vote
4answers
217 views

How to change color of a character while tailing and tr

I regularly use this command line but I would like to change the color of the "|" to green in the output. Does anyone know how I can accomplish this? tail -f file.log | tr '\001' '|' | grep TEST
4
votes
5answers
349 views

Only output most recent 10 (or n) lines of a lengthy command output

I have currently worked alot with shell and bash on linux. I have made tons of backups scripts and much more. In many cases I have a command that outputs thousands of lines. I actually need these ...
1
vote
2answers
88 views

How to hide the . and .. from ls

When I run ls -l on a directory, I see an entry titled '.' How can I remove the row containing '.' from the output? ls -latr /foo | tail -n5 -rw-rw-r-- 1 guest bar 59169 Aug 20 12:22 ...