Questions tagged [tail]

The tail is the part of a list that comes after the head. It's also a unix command that shows the last lines of a file.

Depending on the context tail may refer to:

  • the part of a list that comes after the head i.e. the list you obtain when you remove the first element.

  • the tail unix command which displays the last lines of a file. It's counterpart which displays the first lines is head (). Example: tail -n 10 file will output last 10 lines of file.


See also:

1032 questions
13
votes
1 answer

Incorrect results with bash process substitution and tail?

Using bash process substitution, I want to run two different commands on a file simultaneously. In this example it is not necessary but imagine that "cat /usr/share/dict/words" was a very expensive operation such as uncompressing a 50gb file. cat…
Uncle Long Hair
  • 2,719
  • 3
  • 23
  • 33
13
votes
4 answers

Is there a way to perform a "tail -f" from an url?

I currently use tail -f to monitor a log file: this way I get an autorefreshing console monitoring a web server. Now, said webserver was moved to another host and I have no shell privileges for that. Nevertheless I have a .txt network path, which in…
Phate
  • 6,066
  • 15
  • 73
  • 138
13
votes
3 answers

tail multiple files and grep the output

I would like to grep a pattern from multiple log files which are being constantly updated by some processes and tail the output of this grep continuosly. Below command doesnt work and I get tail: warning: following standard input indefinitely…
212
  • 915
  • 3
  • 9
  • 19
12
votes
3 answers

Minimum Websocket Nodejs Tail Example

I'm trying to create a stream of data to the browser using websocket. The data is the output of a log file. (tail -f filename) Using node js, I've manage to log into stdout, but I haven't been able to create the server and create the client…
jdelard
  • 450
  • 1
  • 4
  • 11
12
votes
3 answers

How can I see the colored log using tail or less?

Reading a Rails log with vim, we can see a colored log. But when we use tail -f or less to watch the log, it isn't colorized anymore. Is there any way to see the colored log with tail or less or whatever?
Benjamin
  • 10,085
  • 19
  • 80
  • 130
11
votes
1 answer

Combine tail -F and json

My log files have one json object per line. I use [json][1] to get a human readable output via cat mylog.log | json -a field1 field2 Now I would like to have tail -F mylog.log | json -a field1 field2 for a continuous output. But this seems not…
osdf
  • 818
  • 10
  • 20
11
votes
5 answers

Development.log log file isn't logging Rails SQL queries

I am following Michael Hartl's Rails Tutorial Here: http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-one#top I use this command to track the SQL queries in a separate window: tail -f log/development.log However while I am in the…
Andrew Lauer Barinov
  • 5,694
  • 10
  • 59
  • 83
11
votes
5 answers

Web implementation of "tail -f filename"?

I have a log file and want to create a webpage (possibly Python but not strictly) that will work much like unix "tail -f filename" command works (show new log lines when they are written to file). So that user will continuously see log right in…
Evgenyt
  • 10,201
  • 12
  • 40
  • 44
11
votes
6 answers

How to tail -f the latest log file with a given pattern

I work with some log system which creates a log file every hour, like follows: SoftwareLog.2010-08-01-08 SoftwareLog.2010-08-01-09 SoftwareLog.2010-08-01-10 I'm trying to tail to follow the latest log file giving a pattern (e.g. SoftwareLog*) and I…
Axiverse
  • 1,589
  • 3
  • 14
  • 30
11
votes
3 answers

How to continuously tail remote files using ansible?

How is it possible to tail a file located at several remote servers in a known location using ansible? This question is based on this comment on this Hacker News thread: In my company, we have hundred machines and tailing done with ansible. If we…
neowulf33
  • 635
  • 2
  • 7
  • 19
10
votes
6 answers

Python to emulate remote tail -f?

We have several application servers, and a central monitoring server. We are currently running ssh with "tail -f" from the monitoring server to stream several text logfiles in realtime from the app servers. The issue, apart from the brittleness of…
victorhooi
  • 16,775
  • 22
  • 90
  • 113
10
votes
3 answers

head, tail and backward read by lines of a text file

How to implement somethig like the 'head' and 'tail' commands in python and backward read by lines of a text file?
user739650
  • 103
  • 1
  • 1
  • 4
10
votes
4 answers

Tail call optimization for fibonacci function in java

I was studying about Tail call recursion and came across some documentation that mentioned. Sun Java doesn't implement tail call optimization. I wrote following code to calculate fibonacci number in 3 different ways: 1. Iterative 2. Head…
TTP
  • 101
  • 1
  • 4
10
votes
3 answers

tail and grep log and mail (linux)

i want to tail log file with grep and sent it via mail like: tail -f /var/log/foo.log | grep error | mail -s subject name@example.com how can i do this?
askaquestion
  • 141
  • 1
  • 2
  • 4
10
votes
3 answers

What's the Solaris equivalent to the BSD's 'tail -n100'?

I've looked this up a thousand times, and I always forget it, so, here for eternity: Solaris has a bit of an awkward syntax for tail. How do I do the equivalent of BSD's tail -nN? What I want are the last N lines from tail's input.
kch
  • 77,385
  • 46
  • 136
  • 148