The tail utility shall copy its input file to the standard output beginning at a designated place. The application shall ensure that the number option-argument is a decimal integer, optionally including a sign. The sign shall affect the location in the file, measured in bytes, to begin the copying: Sign Copying Starts Relative to the beginning of the file. Relative to the end of the file. none Relative to the end of the file. The standard input shall be used if no file operand is specified, and shall be used if the file operand is '-' and the implementation treats the '-' as meaning standard input. Otherwise, the standard input shall not be used. See the INPUT FILES section. If the -c option is specified, the input file can contain arbitrary data; otherwise, the input file shall be a text file. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( The designated portion of the input file shall be written to standard output. The -c option should be used with caution when the input is a text file containing multi-byte characters; it may produce output that does not start on a character boundary. Although the input file to tail can be any type, the results might not be what would be expected on some character special device files or on file types not described by the System Interfaces volume of POSIX.1-2017. Since this volume of POSIX.1-2017 does not specify the block size used when doing input, tail need not read all of the data from devices that only perform block transfers. prints the last ten lines of the file fred , followed by any lines that are appended to fred between the time tail is initiated and killed. As another example, the command: prints the last 15 bytes of the file fred , followed by any bytes that are appended to fred between the time tail is initiated and killed. This version of tail was created to allow conformance to the Utility Syntax Guidelines. The historical -b option was omitted because of the general non-portability of block-sized units of text. The -c option historically meant "characters", but this volume of POSIX.1-2017 indicates that it means "bytes". This was selected to allow reasonable implementations when multi-byte characters are possible; it was not named -b to avoid confusion with the historical -b . The origin of counting both lines and bytes is 1, matching all widespread historical implementations. Hence tail -n +0 is not conforming usage because it attempts to output line zero; but note that tail -n 0 does conform, and outputs nothing. The restriction on the internal buffer is a compromise between the historical System V implementation of 4096 bytes and the BSD 32768 bytes. The -f option has been implemented as a loop that sleeps for 1 second and copies any bytes that are available. This is sufficient, but if more efficient methods of determining when new data are available are developed, implementations are encouraged to use them. Historical documentation indicates that tail ignores the -f option if the input file is a pipe (pipe and FIFO on systems that support FIFOs). On BSD-based systems, this has been true; on System V-based systems, this was true when input was taken from standard input, but it did not ignore the -f flag if a FIFO was named as the file operand.
Excerpt from a page describing this subject · 12,082 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).