{ "name": "tail", "section": 1, "title": "copy the last part of a file", "synopsis": ["tail [OPTION]... [OPERAND]..."], "description": "Prints the last part of each file. Supports -n (line count, including +N to start at line N), -c (bytes, including +K to start at byte K), and -f/--follow for Hyperdrive-backed files. Follow mode uses vfs.watch when available (see BARE_OS_VFS_WATCH) and otherwise polls (BARE_OS_TAIL_F_POLL_MS, default 1000). For automated tests, BARE_OS_TAIL_F_MAX_ROUNDS limits poll iterations (unset = unlimited). Stdin follow is not supported (shell stdin is a captured string). Following multiple files at once is not supported.", "options": [ { "flag": "-n, --lines=[+]NUM", "meaning": "Last NUM lines, or from line NUM onward if +NUM" }, { "flag": "-c, --bytes=[+]NUM", "meaning": "Last NUM bytes, or from byte NUM onward if +NUM" }, { "flag": "-f, --follow", "meaning": "Print appended data as the file grows (one file only)" }, { "flag": "-F", "meaning": "Same as -f (retry-on-truncate not distinct on Bare OS)" } ], "environment": [ "BARE_OS_TAIL_F_POLL_MS — milliseconds between polls when watch is unavailable or capped", "BARE_OS_TAIL_F_MAX_ROUNDS — max poll cycles after initial output (empty = unlimited)", "BARE_OS_VFS_WATCH=0 — disable Hyperdrive watch; tail -f uses polling only" ], "keywords": ["tail", "follow", "log", "bare-os", "coreutils"], "seeAlso": [{ "name": "head", "section": 1 }], "examples": [ { "caption": "last lines", "code": "tail -n 20 app.log" }, { "caption": "follow a log", "code": "tail -f /var/log/app.log" }, { "caption": "last bytes", "code": "tail -c 512 image.bin" } ], "listCategory": "coreutils" }