| Crates.io | aki-unbody |
| lib.rs | aki-unbody |
| version | 0.2.0 |
| created_at | 2021-03-02 03:16:52.31987+00 |
| updated_at | 2025-09-15 13:29:11.424689+00 |
| description | output first or last n lines, like a head and tail of linux command. |
| homepage | |
| repository | https://github.com/aki-akaguma/aki-unbody |
| max_upload_size | |
| id | 362437 |
| size | 114,842 |
output first or last n lines, like a head and tail of linux command.
aki-unbody --help
Usage:
aki-unbody [options]
output first or last n lines, like a head and tail of linux command.
Options:
-h, --head <num> output the first <num> lines.
-t, --tail <num> output the last <num> lines.
-i, --inverse output the body, except for head and tail.
-H, --help display this help and exit
-V, --version display version information and exit
Examples:
Outputs first 2 lines:
cat file1.txt | aki-unbody --head 2
Outputs last 2 lines:
cat file1.txt | aki-unbody --tail 2
Outputs body, except for first 2 lines and last 2 lines:
cat file1.txt | aki-unbody --head 2 --tail 2 --inverse
cargo install aki-unbody
cargo deb
and install .deb into your local repository of debian package.
The input data used in this example looks like this:
cat file1.txt
result output:
LN:0001,text
LN:0002,text
LN:0003,text
LN:0004,text
LN:0005,text
LN:0006,text
Outputs first 2 lines.
command line:
cat file1.txt | aki-unbody --head 2
result output:
LN:0001,text
LN:0002,text
Outputs last 2 lines.
command line:
cat file1.txt | aki-unbody --tail 2
result output:
LN:0005,text
LN:0006,text
Outputs first 2 lines and last 2 lines.
command line:
cat file1.txt | aki-unbody --head 2 --tail 2
result output:
LN:0001,text
LN:0002,text
LN:0005,text
LN:0006,text
Outputs body, except for first 2 lines and last 2 lines.
command line:
cat file1.txt | aki-unbody --head 2 --tail 2 --inverse
result output:
LN:0003,text
LN:0004,text
See fn execute() for this library examples.
This project is licensed under either of
at your option.