|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
News | Syntax | Recommended Links | Sorting algorithms | Recommended Papers | Rcut | Reference | Pipes |
Perl re-implemenations | uniq | sort | tr | AWK | Tips | Humor | Etc |
|
Unix tail tail command is a standard way of watching log files in Unix. There is also less well known, but more useful utility called since which is distributed with Cygwin package and can be compiled on any Unix platform. It is capable remembering the last line of the file viewed so only new lines are displayed.
|
since - display content of a file since the last time
since [-hnqvx] files
DESCRIPTION
since is similar to tail since it also displays the tail of a file. However since displays only the data which has been added since the last time since was run. If since has not been run before the entire file is displayed. since is useful for watching over log files.
EXAMPLE
since /var/log/apache/{access,error}_log > /dev/null
lynx --dump http://localhost/ > /dev/null
since /var/log/apache/{access,error}_logOPTIONS
- -h Print a terse help message.
- -n Do not update the .since file which keeps track of file growth.
- -q Decrease the verbosity of the output.
- -v Increase the verbosity of the output.
- -x Exclude files with compressed extensions.
FILES
.since
File recording the length of the files displayed previously. The location of the file can be set by using the SINCE environment variable, for example export SINCE= /var/log/sincefile will tell since to use the file /var/log/sincefile. If the SINCE environment variable has not been set since will use the HOME environment variable and store the information in the file .since in the directory pointed to by the variable. If neither the SINCE nor the HOME variable are set since will use the file /tmp/since.
BUGS
since will break when used across NFS on architectures which have different st_* field sizes. since uses the inode of a file as its key, if that inode is recycled since might get confused. since is not particularly efficient when storing the stat() information, but should work reasonably well unless you plan to look at thousands of files. Functionality equivalent to since can probably be achieved with a number of trivial shell scripts.
COPYING
since may only be used, distributed and modified in accordance with the terms of the GPL (GNU General Public License) as published by the FSF (Free Software Foundation).
SEE ALSO
tail(1), stat(2).
Linux JULY 1998 SINCE(1)
since - display content of a file since the last time
since [-hnqvx] files
DESCRIPTION
since is similar to tail since it also displays the tail of a file. However since displays only the data which has been added since the last time since was run. If since has not been run before the entire file is displayed. since is useful for watching over log files.
EXAMPLE
since /var/log/apache/{access,error}_log > /dev/null
lynx --dump http://localhost/ > /dev/null
since /var/log/apache/{access,error}_logOPTIONS
- -h Print a terse help message.
- -n Do not update the .since file which keeps track of file growth.
- -q Decrease the verbosity of the output.
- -v Increase the verbosity of the output.
- -x Exclude files with compressed extensions.
FILES
.since
File recording the length of the files displayed previously. The location of the file can be set by using the SINCE environment variable, for example export SINCE= /var/log/sincefile will tell since to use the file /var/log/sincefile. If the SINCE
MultiTail lets you view one or multiple files like the original tail program. The difference is that it creates multiple windows on your console (with ncurses). It can also monitor wildcards: if another file matching the wildcard has a more recent modification date, it will automatically switch to that file. That way you can, for example, monitor a complete directory of files. Merging of 2 or even more logfiles is possible. It can also use colors while displaying the logfiles (through regular expressions), for faster recognition of what is important and what not. It can also filter lines (again with regular expressions). It has interactive menus for editing given regular expressions and deleting and adding windows. One can also have windows with the output of shell scripts and other software.
When viewing the output of external software, MultiTail can mimic the functionality of tools like 'watch' and such.
For a complete list of features, look here.
inotail is a replacement for the 'tail' program found in the base installation of every Linux/UNIX system. It makes use of the inotify infrastructure in recent versions of the Linux kernel to speed up tailing files in the follow mode (the '-f' option). Standard tail polls the file every second by default while inotail listens to special events sent by the kernel through the inotify API to determine whether a file needs to be reread.
Currently inotail is not fully compatible to neither POSIX or GNU tail but might be in the future. (Note: I'm currently working on correct tailing from pipes which would make inotail fully compatible to POSIX tail)
- Linux kernel 2.6.13 or higher with CONFIG_INOTIFY enabled
- Standard C Library (tested with GNU libc but might work with others too)
2007-09-07 - inotail 0.5 released
Released version 0.5 of inotail containing only small fixes. Please refer to the changelog for details.
download
Debian users can find the inotail package in the Debian package archive. inotail is also available in the Ubuntu Universe repository.
#!/usr/bin/perl -w
#
# A Perl implementation of tail for the Perl Power Tools project by
# Thierry Bézecourt <[email protected]>. Includes an implementation
# of Chip Rosenthal's xtail.
#
# Please see the pod documentation at the end of this file.
#
# 99/12/24 : made tail -f work on VMS (thanks to Joe Kazimierczyk)
# fixed a bug when tailing small files
# 99/11/19 : important performance improvement for tail on big files
# (now usable for any file size)
# 99/03/07 : implemented xtail in the -f option
# 99/03/03 : fixed the -f option which was completely broken
# 99/03/02 : first version
This is the homepage for the Perl Power Tools implementation of the standard tail command.
Current Perl implementations are:Baseline documentation:
- Here is a version and its manpage by Thierry Bezecourt (1999-03-07).
Supporting files: readme.thierry, mktest.thierry.
#!/usr/bin/perl
use File::Tail;
$file=File::Tail->new( $file_to_tail );
while (defined($line=$file->read))
{
print $line;
}
The output from other commands can be piped (i.e., sent) to tail to use as its input. For example, the following sends the output from the ls command (which by default lists the names of the files and directories in the current directory) to tail, which, in turn, prints the final ten lines of the output that it receives from ls to the monitor screen:
ls | tail
This output could easily be redirected, for example to a file named last_filenames as follows:
ls | tail >> last_filenames
It could also be piped to one or more filters for additional processing. For example, the sort filter could be used with its -r option to sort the output in reverse alphabetic order prior to writing to a file:
ls | tail | sort -r >> last_filenames
The -q (i.e., quiet) option causes tail to not print the file name before each set of lines and to eliminate the vertical space between each set of lines when there are multiple input sources. The -v (i.e., verbose) option causes tail to print the file name even if there is just a single input file.
Tail could be viewed as a counterpart of the head command, which always starts reading from the beginning of files and which can continue until any specified distance from the beginning. However, there are a few differences. Perhaps the most useful of these is that tail is somewhat more flexible in that, in addition to being able to start reading any specified distance from the end of a file, it can also start at any specified distance from the beginning of a file.
Tail can be instructed to begin printing from some number of lines or bytes from the start of a file by preceding the number with a plus sign instead of a minus sign. For example, the following would print each of the designated files to the display monitor beginning with the seventh line and until the end:
tail +7 aardvark anteater armadillo
The c option could be used to tell tail to print each of the designated files beginning with the seventh byte instead of the seventh line:
tail +7c aardvark anteater armadillo
inotail is a replacement for the 'tail' program found in the base installation of every Linux/Unix system. It makes use of the inotify infrastructure in recent versions of the Linux kernel to speed up tailing files in the follow mode (the '-f' option). Standard tail polls the file every second by default, while inotail listens to special events sent by the kernel through the inotify API to determine whether a file needs to be reread.
Similarly, tail shows the last few lines (again, 10 by default) of a file or stream:
% ypcat passwd | tail cal:*:1492:160:Calvin Hobbes:/home/cal:/bin/csh adams:*:116:100:John Adams:/home/pkduck-b/adams:/bin/csh gary:*:1177:20:Gary North:/home/pkduck-e/gary:/bin/csh quincy:*:1092:20:Quincy Lizard:/home/triton-a/quincy:/bin/csh talbot:*:1679:75:Bob Talbot:/home/enterprise-a/cadmec/talbot:/bin/csh help:*:1034:31:Help Desk:/home/lewey-a/processor/help:/bin/csh glen:*:1543:20:Glen Carpenter:/home/pkduck-e/glen:/bin/csh brent:*:1799:706:Brent Adams:/home/dogbert-a/brent:/bin/csh lou:*:1701:30:Lou Grant:/home/pkduck-h/lou:/bin/csh adam:*:1124:317:Adam Baker:/home/lewey-d/adam:/bin/csh
As with head, you can specify the number of lines from the end of the file at which to start display by prefacing the number with a hyphen ("-"). You can also specify the location as a number of lines from the beginning by prefacing the number with a plus sign ("+"):
% wc -l /usr/man/man1/tail.1 143 /usr/man/man1/tail.1 % tail +141 /usr/man/man1/tail.1 .LP Various kinds of anomalous behavior may happen with character special files. % tail -3 /usr/man/man1/tail.1 .LP Various kinds of anomalous behavior may happen with character special files.
Since the tail man page has 143 lines, "tail +141" is equivalent to "tail -3" in this case.Unlike with head, tail will operate on units other than lines. By adding the character "b" to the number, you can display the last blocks, and with "c" the last characters:
% tail -10c /usr/man/man1/tail.1 al files.
Don't forget about newlines.tail also has the unexpected function that it allows you to reverse the lines spewed. By default, with just the "-r" flag, tail displays the whole file in reverse order by line:
% cat > foo << END this is a test END % tail -r foo test a is this
A number of lines to reverse can be included, but it cannot be relative to the beginning of the file, only the end. ("+" acts just like "-")tail also has the wildly useful feature that it can be told to wait around for further input to a file rather than stopping when it gets to the end. This is especially useful to monitor the progress of a process whose output you have redirected to a file:
% clearmake >& Transcript & [1] 12688 % tail -f Transcript[the output from the clearmake will be displayed here as it arrives in "Transcript"]
When called in this manner, the tail will continue to read lines from the file and wait for more until you kill it ("^C" is handy here ;-) even after the clearmake has completed and there is no longer output being appended to the file.One final difference between head and tail: while head will operate on multiple files, tail will not, so don't expect something like "tail foo bar biff" to show anything more than the last 10 lines of "foo".
|
OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/openSUSE_Factory/i586/since-0.5-2.70.i586.rpm OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/openSUSE_Factory/x86_64/since-0.5-2.34.x86_64.rpm OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/openSUSE_11.0/x86_64/since-0.5-2.1.x86_64.rpm OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/openSUSE_10.3/x86_64/since-0.5-2.1.x86_64.rpm OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/SLE_10/x86_64/since-0.5-2.1.x86_64.rpm OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/SLE_10/i586/since-0.5-2.1.i586.rpm OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/openSUSE_11.0/i586/since-0.5-2.1.i586.rpm OpenSuSE ftp5.gwdg.de/pub/opensuse/repositories/home:/darix/openSUSE_10.3/i586/since-0.5-2.1.i586.rpm
since is a tail(1) work-alike that remembers how much of a file you have viewed and displays only what's new when you next view that file.
Downloaded from: ftp://ftp.linux.ucla.edu/debian/pool/main/s/since/ Last update: 2002/01/30
AIX Version Binary Source 4.1 0.3 [Download] (8.0 KB) [Download] (25.5 KB) 4.2 0.3 [Download] (8.1 KB) [Download] (25.5 KB) 4.3 0.3 [Download] (8.1 KB) [Download] (25.7 KB) 5.1 0.3 [Download] (21.5 KB) [Download] (40.3 KB) Please note that some browsers download the files as uncompressed tar archives
Problems downloading? Please read the FAQ
Google matched content |
MultiTail
Most admins are already familiar with using tail -f logfile to watch system, application, and error logs when they're troubleshooting. However, the tail utility only follows one file at a time. If you need to watch two or more logfiles at the same time, which is fairly common, the MultiTail < http://www.vanheusden.com/multitail/ > utility by Folkert van Heusden is an excellent tool to have handy.
Basically, MultiTail handles two or more files simultaneously, and presents them in a split-screen view that makes it convenient to watch two, three, or more logfiles at the same time. This has come in particularly handy for me when troubleshooting issues with Web sites and mail issues. Technically, one can replicate the MultiTail experience by using GNU Screen to create a split screen environment and using |tail -f /logfile/ |multiple times -- but why? MultiTail makes it simple.
inotail is a replacement for the 'tail' program found in the base installation of every Linux/Unix system. It makes use of the inotify infrastructure in recent versions of the Linux kernel to speed up tailing files in the follow mode (the '-f' option). Standard tail polls the file every second by default, while inotail listens to special events sent by the kernel through the inotify API to determine whether a file needs to be reread.
Society
Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers : Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism : The Iron Law of Oligarchy : Libertarian Philosophy
Quotes
War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda : SE quotes : Language Design and Programming Quotes : Random IT-related quotes : Somerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose Bierce : Bernard Shaw : Mark Twain Quotes
Bulletin:
Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 : Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law
History:
Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds : Larry Wall : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOS : Programming Languages History : PL/1 : Simula 67 : C : History of GCC development : Scripting Languages : Perl history : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history
Classic books:
The Peter Principle : Parkinson Law : 1984 : The Mythical Man-Month : How to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite
Most popular humor pages:
Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor
The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D
Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.
This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...
|
You can use PayPal to to buy a cup of coffee for authors of this site |
Disclaimer:
The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.
Last modified: March 12, 2019