tail
Return the last N lines from files or stdin as JSON (default 10). View recent file additions or check log tails. Supports negative N to skip first lines.
Instructions
Return the last N lines (default 10) of files or stdin as JSON. Read-only, no side effects. Returns JSON with line array by default; use --raw for plain text. Supports negative-N to skip the first N lines. Use to view recent file additions or check log tails. Not for viewing file beginnings — use 'head'. See also 'head', 'cat'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write raw selected lines without a JSON envelope. | |
| path | Yes | File to read. | |
| lines | No | Number of lines. | |
| encoding | No | Text encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| show_encoding | No | Include encoding detection metadata in JSON result. | |
| encoding_errors | No | How to handle encoding errors (default: replace). | replace |
| encoding_profile | No | Locale-aware encoding fallback profile for auto-detection. |