Share to: share facebook share twitter share wa share telegram print page

Tail (Unix)

tail
Developer(s)Various open-source and commercial developers
Written inC
Operating systemUnix, Unix-like, V, Plan 9, Inferno, MSX-DOS, FreeDOS
PlatformCross-platform
TypeCommand
LicensePlan 9: Lucent Public License or GPLv2 or MIT License
coreutils: GPLv3+

tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.

Implementations

The version of tail bundled in GNU coreutils was written by Paul Rubin, David MacKenzie, Ian Lance Taylor, and Jim Meyering.[1] The command is available as a separate package for Microsoft Windows as part of the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.[2] The FreeDOS version was developed by M. Aitchison.[3] A tail command is also part of ASCII's MSX-DOS2 Tools for MSX-DOS version 2.[4]

CCZE is tail-like while displaying its output in color.[5]

pctail is similar to CCZE. It is a colorized tail programmed in Python which tails and colorizes syslog output.[6]

Inotail was an implementation using the inotify Linux kernel interface (introduced in version 2.6.13 in August 2005) to check whether new data is available instead of polling every second, as the original tail did.[7] However, newer versions[which?] of tail also started using inotifiy when possible, so Inotail became deprecated and is not longer maintained.

MultiTail not only displays logfiles in colors, it can also merge, filter, scrollback and split a terminal window into subwindows.[8] It is more or less a combination of tail, sed, watch, CCZE/pctail, grep, diff, Beeper and others.

Syntax

The command-syntax is:

tail [options] <filename>

By default, tail will output the last 10 lines of its input to the standard output. With command line options, the amount of output and the units (lines, blocks or bytes) may be changed.

In the following example only the last line of the reports is output:

$ tail -n1 report-13*
==> report-1301 <==
Total tons output for month of January '13 was 523

==> report-1302 <==
Total tons output for month of February '13 was 272

==> report-1303 <==
Total tons output for month of March '13 was 623

This example outputs the last 4 characters of the reports, silently suppressing the filenames. Notice that the count includes the newline character at the end of each line and so the output does not include a leading space one might expect.

$ tail --silent -c4 report*
523
272
623

This example shows all lines of report from the second line onwards:

tail -n +2 report

Using an older syntax (still used in older version of Sun Solaris as the -n option is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command:

tail -20 filename
tail -50c filename

However this syntax is now obsolete and does not conform with the POSIX 1003.1-2001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.

As with all Unix commands, use man pages on the running system for specific options and actions.

File monitoring

tail has two special command line option -f and -F (follow) that allows a file to be monitored. Instead of just displaying the last few lines and exiting, tail displays the lines and then monitors the file. As new lines are added to the file by another process, tail updates the display. This is particularly useful for monitoring log files. Ancient versions of tail poll the file every second by default but tail from the GNU coreutils as of version 7.5 support the inotify infrastructure introduced in Linux kernel version 2.6.13 in August 2005 which only check the file when is notified of changes by the kernel.

The following command will display the last 10 lines of messages and append new lines to the display as new lines are added to messages:

tail -f /var/adm/messages

To keep following the log even when it is recreated, renamed, or removed as part of log rotation, at least BSD and GNU implementations provide a -F option which is useful in cases when the user is following a log file that rotates.

tail -F /var/adm/messages

To interrupt tail while it is monitoring, break-in with Ctrl+C. This command can be run "in the background" with &, see job control.

If the user has a command's result to monitor, the watch command can be used.

There is a GNU Emacs mode that emulates the functionality of tail -f, called auto-revert-tail-mode.

See also

References

  1. ^ "tail(1): output last part of files - Linux man page". linux.die.net.
  2. ^ "Native Win32 ports of some GNU utilities". unxutils.sourceforge.net.
  3. ^ "ibiblio.org FreeDOS Package -- tail (Unix-like)". www.ibiblio.org.
  4. ^ "MSX-DOS2 Tools User's Manual - MSX-DOS2 TOOLS ユーザーズマニュアル". April 1, 1993 – via Internet Archive.
  5. ^ "CCZE". freshmeat.sourceforge.net.
  6. ^ "pctail". SourceForge. 25 February 2013.
  7. ^ "inotail". distanz.ch.
  8. ^ Kalsi, Tajinder (2016). Practical Linux Security Cookbook. Packt Publishing Ltd. pp. 234–236. ISBN 9781785285301. Retrieved 22 September 2017.

Read other articles:

Tom yum goong RESEP BUMBU TOM YAM Tom yam (bahasa Thai: ต้มยำ, IPA: [tôm jām], inggris : tom yum) adalah sup yang berasal dari Thailand. Sup ini merupakan salah satu makanan Thailand yang terkenal. Di Thailand, tom yam biasanya dibuat dengan udang (tom yum goong), ayam (tom yum gai), ikan (tom yum pla), atau makanan laut yang dicampur (tom yum talay atau tom yum po taek) dan jamur. Pranala luar Resep Tom Yam Diarsipkan 2012-01-12 di Wayback Machine.Tom Yum asli Thailand ...

American curler Tabitha PetersonCurlerBorn (1989-03-06) March 6, 1989 (age 34)Burnsville, MinnesotaTeamCurling clubSt. Paul Curling Club,St. Paul, MinnesotaSkipTabitha PetersonThirdCory ThiesseSecondTara PetersonLeadBecca HamiltonAlternateVicky PersingerMixed doublespartnerJoe PoloCurling career Member Association United StatesWorld Championshipappearances6 (2012, 2014, 2016, 2017, 2021, 2023)World Mixed Doubles Championshipappearances2 (2016, 2021)Pan Continental Championshipappear...

Esta página cita fontes, mas que não cobrem todo o conteúdo. Ajude a inserir referências. Conteúdo não verificável pode ser removido.—Encontre fontes: ABW  • CAPES  • Google (N • L • A) (Setembro de 2020) A seguir se apresenta a lista de personagens de Game of Thrones, uma série de televisão na qual apresenta o continente fictício de Westeros e Essos, mostrando as violentas lutas pelo poder entre as famílias nobres par...

Lucien Jottrand Lucien Joseph Léopold Jottrand (* 30. Januar 1804 in Genappe; † 17. Dezember 1877 in Saint-Josse-ten-Noode) war ein belgischer Journalist und Politiker. Inhaltsverzeichnis 1 Leben 2 Werke 3 Literatur 4 Weblinks 5 Einzelnachweise Leben Jottrand studierte an der Universität Lüttich Rechtswissenschaften und wurde nach seiner Promotion 1825 Rechtsanwalt am Gerichtshof in Brüssel. Besondere Bedeutung erlangte er seit 1826 als Redakteur der oppositionellen Zeitung Courrier des...

Roosevelt Vista de la estaciónUbicaciónCoordenadas 47°40′36″N 122°18′58″O / 47.6767, -122.316Dirección 12th Avenue NE & NE 65th StreetSeattle, WashingtonDatos de la estaciónInauguración 2021[1]​Servicios N.º de andenes 1 plataforma centralN.º de vías 2Operador Sound TransitAdministración Sound Transit y King County MetroLíneasLínea(s) Central Link U District (2021) ← Northgate Link → Northgate (2021) Mapa Roosevelt Ubicación de la estación ...

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (أبريل 2019) فريدريك فون مولر (بالألمانية: Friedrich von Müller)‏    معلومات شخصية الميلاد 17 سبتمبر 1858[1]  آوغسبورغ  الوفاة 18 نوفمبر 1941 (83 سنة) [1]  ميونخ  مواطن...

This article needs to be updated. Please help update this article to reflect recent events or newly available information. (November 2020) Unless a visa or an official warrant is issued by Azerbaijani authorities, the government of Azerbaijan condemns any visit by foreign citizens to the Republic of Artsakh, its surrounding territories and the Azerbaijani enclaves of Artsvashen, Karki, Yuxarı Əskipara, Barxudarlı and Sofulu which are de jure part of Azerbaijan under Armenian control. Azerb...

2015 studio album by Don HenleyCass CountyStudio album by Don HenleyReleasedSeptember 25, 2015Recorded2014–2015StudioRed Oak Studios and Luminous Sound (Dallas, Texas); Allentown Studios, Sound Emporium, Blackbird Studio and House of Blues Studios (Nashville, Tennessee)GenreCountry, rockLength48:43LabelPast Masters Holdings, Capitol RecordsProducerDon Henley, Stan LynchDon Henley chronology The Very Best of Don Henley(2009) Cass County(2015) Cass County is the fifth solo studio albu...

Richard A. SearfossBorn(1956-06-05)June 5, 1956Mount Clemens, Michigan, U.S.DiedSeptember 29, 2018(2018-09-29) (aged 62)Tehachapi, California, U.S.NationalityAmericanOther namesRick Searfoss[1]Alma materUSAFA, B.S. 1978Caltech, M.S. 1979OccupationTest pilotSpace careerNASA AstronautRankColonel, USAFTime in space39d 03h 18mSelection1990 NASA Group 13MissionsSTS-58, STS-76, STS-90Mission insignia Richard Alan Searfoss (June 5, 1956 – September 29, 2018) was an American ...

Japanese anime television series Fantastic ChildrenCover art of the third volume of the DVD compilation of Fantastic Children by Bandai Entertainmentファンタジックチルドレン(Fantajikku Chirudoren)GenreAdventure, romance, science fiction[1][2] Anime television seriesDirected byTakashi NakamuraWritten byHideki MitsuiTakashi NakamuraMusic byKōji UenoYang Bang-eanStudioNippon AnimationLicensed byEU: Beez EntertainmentNA: Bandai EntertainmentSA: Ani...

 Główny artykuł: Mistrzostwa Świata w Lekkoatletyce 2017. Mistrzostwa Świata w Lekkoatletyce 2017Chód na 20 km mężczyzn Éider Arévalo Siergiej Szyrobokow Caio Bonfim Chód na 20 kilometrów mężczyzn – jedna z konkurencji długodystansowych rozegranych podczas lekkoatletycznych mistrzostw świata na Stadionie Olimpijskim w Londynie. Terminarz Data Godzina[1] 13 sierpnia 14:20[2] Finał Rekordy Tabela prezentuje rekord świata, rekordy poszczególnych kontynentów, mistrzostw...

English naturalist and explorer For other people named John Gilbert, see John Gilbert (disambiguation). A memorial to Gilbert on the wall of St James' Church, Sydney John Gilbert (14 March 1812[citation needed] – 28 June 1845) was an English naturalist and explorer. Gilbert is often cited in the earliest descriptions of many Australian animals, many of which were unrecorded in European literature, and some of these are named for him by those authors. Gilbert was sent to the newly fo...

For the fictional band, see List of minor The Hitchhiker's Guide to the Galaxy characters § Hotblack_Desiato. Region or location that is heavily damaged by a natural or man-made hazard Hovercraft delivering aid to Meulaboh, on the island of Sumatra in Indonesia in the aftermath of the 2004 tsunami. A disaster area is a region or a locale that has been heavily damaged by either natural, technological or social hazards. Disaster areas affect the population living in the community by drama...

Machmud Singgirei RumagesanRaja al-Alam Ugar Pik-Pik SekarLukisan Machmud Singgirei RumagesanBerkuasa1915PendahuluRaja Kabituwar: Pandai/Congan Raja Sekar: Saban Pipi RumagesanPenerusAmir Syahdan Rumagesan[1]Kelahiran(1885-12-27)27 Desember 1885Kokas, Afdeling FakfakKematian5 Juli 1964(1964-07-05) (umur 78)Jakarta, IndonesiaPemakamanTaman Makam Pahlawan Kokas, Kabupaten FakfakWangsaRumagesanAyahSaban Pipi RumagesanAnakAmir Syahdan[1][2] Amina Hadidja Regaija Boke ...

SampungKecamatanPeta lokasi Kecamatan SampungNegara IndonesiaProvinsiJawa TimurKabupatenPonorogoPemerintahan • Camat-Populasi • Total35.200 jiwaKode Kemendagri35.02.14 Kode BPS3502150 Luas80,61 km²[1]Desa/kelurahan12 Sampung adalah sebuah kecamatan di Kabupaten Ponorogo, Provinsi Jawa Timur, Indonesia. Kecamatan ini berjarak sekitar 23 kilometer[2] dari ibu kota Kabupaten Ponorogo ke arah barat laut. Pusat pemerintahannya berada di desa Sampung. K...

This article is part of a series aboutBongbong Marcos 17th President of the PhilippinesIncumbent Political campaigns 2016 vice presidential election VP campaign 2022 Philippine presidential election campaign endorsements Presidency Presidential transition Inauguration Administration and cabinet Major acts Executive orders 19th Congress International trips Protests Speeches State of the Nation Address 2022 2023 COVID-19 pandemic in the Philippines Sugar crisis Airspace closure Onion crisis Pol...

IthakaThe slaughter of the suitors on a Campanian red-figure bell-krater, ca. 330 BCWritten byBotho StraußDate premiered17 July 1996 (1996-07-17)Place premieredMunich Kammerspiele, MunichOriginal languageGerman Ithaka is a 1996 play by the German writer Botho Strauß. It has the subtitle Schauspiel nach den Heimkehr-Gesängen der Odyssee, meaning play after the homecoming songs from the Odyssey. It tells the story of how Odysseus, the Greek hero from the Trojan War, returns af...

American weekly newspaper Not to be confused with The Colorado Statesman. The Denver StarTypeWeekly newspaperFounded1913Ceased publication1963HeadquartersDenver, Colorado, U.S.ISSN2577-2376OCLC number10571156 Franklin's Paper, The StatesmanFounder(s)Clara Williams Franklin, Chester Arthur FranklinFounded1901Ceased publication1913ISSN2577-2333OCLC number23238142 The StatesmanThe Statesman founder and editor, Joseph D.D. Rivers (c. 1900)Founder(s)Joseph D.D. RiversFounded1888Ceased publication1...

Upazila in Rajshahi Division, BangladeshIshwardi ঈশ্বরদীUpazilaIshwardiLocation of Ishwardi city in Rajshshi DivisionShow map of Bangladesh Rajshahi divisionIshwardiLocation in BangladeshShow map of BangladeshCoordinates: 24°9′N 89°4′E / 24.150°N 89.067°E / 24.150; 89.067Country BangladeshDivisionRajshahi DivisionDistrictPabna DistrictGovernment • TypeLocal government • BodyUpazila Parishad • Upazila Chairm...

Coordenadas: 49° 29' N 9° 17' E Distrito do Necar-Floresta de Oden Brasão de Distrito do Necar-Floresta de Odenbrasão Localização de Distrito do Necar-Floresta de Oden na Alemanhamapa Dados Estado Baden-Württemberg Capital Mosbach Região Adm. Karlsruhe Área 1.126,34 km² População (31/12/2007) 149.572 hab. Densidade 133 hab/km² Website www.neckar-odenwald-kreis.de Administração distrital Endereço Renzstraße 1074821 Mosbach Administrador Dr. Achim Brötel Localização ...

Kembali kehalaman sebelumnya