head

    head command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.1.1
    License
    Apache-2.0
    Last updated
    15 days ago
    Downloads
    12

    Dependencies

    #head for moonx

    Print the first lines or bytes of files or stdin:

    printf '1\n2\n3\n' | moonx cli/head -n 2 moonx cli/head -c 16 data.bin

    Options: -n N first N lines (default 10), -c N first N bytes, -q/-v control the ==> file <== headers shown for multiple files.

    Input is streamed in fixed-size chunks and reading stops as soon as the quota is met, so heading a huge file (or an endless pipe) is instant and uses constant memory. Binary data passes through unchanged.

    With no file operand, an interactive terminal receives an EOF waiting prompt; piped, redirected, and explicit - input remain silent.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io