LinuxCommandLibrary

biff

Notify user of incoming mail

TLDR

Print the current time in a format of your choosing

$ biff time fmt [[-f|--format]] rfc3339 now
copy

Print multiple relative times in one command
$ biff time fmt [[-f|--format]] '%c' now -1d 'next sat' 'last monday' '9pm last mon'
copy

Print the current time in another time zone and round it the nearest 15 minute increment
$ biff time in Asia/Bangkok now | biff time round [[-i|--increment]] 15 [[-s|--smallest]] minute
copy

Convert a time between two different time zone
$ TZ='Japan' biff time in America/New_York 02:30
copy

Print a past or future time relative to current time
$ biff time add [-1d|1d|1w|-1m|1y|...] now
copy

Add a complex duration to the current time
$ biff time add '1 week, 12 hours ago' now
copy

Find the duration since a date in the past and round it to the desired precision
$ biff span since 2025-01-20T12:00 [[-l|--largest]] year
copy

Find timestamps in a log file and reformat them into your local time in place
$ biff tag lines /tmp/access.log | biff time in system | biff time fmt [[-f|--format]] '%c' | head [[-n|--lines]] 3 | biff untag [[-s|--substitute]]
copy

SYNOPSIS

biff [y|n] [hostname]

PARAMETERS

y
    Enable mail arrival notifications on terminal

n
    Disable mail arrival notifications on terminal

hostname
    Optional host for notifications (default: local host)

DESCRIPTION

biff controls notifications for new mail arrivals directly on the user's terminal. When enabled, incoming messages trigger a display showing the sender, date/time, subject, and a preview of the first few lines. This uses the comsat(8) daemon on the mail server to send UDP notifications via the biff protocol.

Invoke biff y to enable, biff n to disable. Without arguments, it queries and prints the status: "is y" (enabled) or "is n" (disabled). Specify an optional hostname to set status for mail from a remote host (defaults to local).

biff sets a flag on the invoking terminal, checked by comsat before notifying. It requires write access to the tty (mesg y). Historically valuable in text-only multiuser systems for real-time awareness without manual checks, but now rare due to modern MUAs (e.g., mutt), SSH sessions, tmux/screen, and privacy risks—headers/previews are visible to console onlookers.

Notifications respect tty permissions and only appear on the flagged terminal.

CAVEATS

Requires comsat(8) daemon and mesg y on tty. Insecure for shared terminals (exposes mail publicly). UDP-based; firewalls may block. Obsolete with modern mail tools.

STATUS QUERY

Run biff without args to check: outputs 'biff is y' or 'biff is n'.

NOTIFICATION EXAMPLE

Sample output:
New mail from user@host at Wed 12:34
Subject: Hello
Message preview lines...

HISTORY

Introduced in 4.2BSD (1983). Named after Bill Joy's dog 'Biff', who barked at mail-arrival bell sounds. Deprecated in modern Linux; survives in GNU coreutils/minimal systems.

SEE ALSO

comsat(8), mesg(1), mail(1), write(1)

Copied to clipboard