Monitoring

retail – tail with regular expressions

retail is a command-line utility that extends the traditional tail command with regular-expression matching. It provides greater control over where displayed output begins and when monitoring should stop.

A conventional tail command normally displays the last specified number of lines or bytes from a file. retail adds the ability to locate a matching expression and output content beginning at that point.

This is useful when examining logs containing repeated sections, transaction records, error reports or other text with identifiable boundaries. Rather than manually searching for the relevant section, users can specify a pattern that identifies where the output should begin.

For example, a log containing several application restarts might include a recognisable startup message. retail can locate the last occurrence of that message and display the output that follows it.

The application also supports a second expression that determines when following a file should finish. This allows monitoring to terminate automatically when a particular message or event appears.

retail retains conventional tail functionality alongside these additional matching operations. It accepts files and standard input, allowing it to work with command pipelines and scripts.

Its regular-expression support uses POSIX extended regular expressions, providing a familiar syntax for users already working with tools such as grep and sed.

This is free and open source software.

Key Features

  • Display file content beginning at the last match of a regular expression.
  • Use the -r option to define the starting expression.
  • Start at the first matching line instead of the last using -b.
  • Follow files as new content is appended.
  • Stop following a file when a specified regular expression matches.
  • Use the -u option to define a terminating expression.
  • Include the terminating matching line before exiting.
  • Select the last specified number of lines or bytes.
  • Begin output from a specified line or byte position.
  • Accept input from files or standard input.
  • Use POSIX extended regular expressions with explicit start and end anchors.
  • Provide conventional tail operations alongside pattern-based extensions.

Website: github.com/mwh/retail
Support:
Developer: Michael Homer
License: GNU General Public License v3.0

retail help

retail is written in C. Learn C with our recommended free books and free tutorials.

Alternatives to tail


Explore Linux

Best Free and Open Source Software - A huge collection of recommended free and open source software covering every major category.
In-depth Linux Software Reviews - Detailed assessments of Linux software covering features, usability and overall quality.

The Big List of Active Linux Distros - An extensive collection of actively developed Linux distributions.
Open Source Alternatives - Alternatives to software and services from Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle and others.
Essential Linux System Tools - Indispensable utilities for monitoring, maintaining and managing Linux systems.
Linux Productivity Tools - Useful utilities for improving productivity and streamlining everyday tasks.
Alternatives to Popular CLI Tools - Modern alternatives to familiar command-line utilities supplied with Linux systems.
Awesome Free Linux Game Tools - Tools, utilities and companion software that improve gaming on Linux.
Machine Learning on Linux - Machine learning and deep learning software, self-hosted applications and practical tools.
Saving Money with Linux - Practical ways to reduce electricity consumption and lower computing costs with Linux.
Linux Candy - Fun, entertaining and sometimes delightfully quirky software from the lighter side of Linux.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted