Skip to main content

Module head

Module head 

Source

Structs§

HeadConfig
Configuration for head

Enums§

HeadMode
Mode for head operation

Functions§

head_bytes
Output first N bytes from data
head_bytes_from_end
Output all but last N bytes from data
head_file
Process a single file/stdin for head
head_lines
Output first N lines from data
head_lines_from_end
Output all but last N lines from data
head_stdin_lines_streaming
Process head for stdin streaming (line mode, positive count) Reads chunks and counts lines, stopping early once count reached.
parse_size
Parse a numeric argument with optional suffix (K, M, G, etc.) Supports: b(512), kB(1000), K(1024), MB(1e6), M(1048576), GB(1e9), G(1<<30), TB, T, PB, P, EB, E, ZB, Z, YB, Y
sendfile_bytes
Use sendfile for zero-copy byte output on Linux