Skip to content

michaelbutler/rhead

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rhead

A head clone written in Rust.

"head" is a command line utility which gives you the first n lines (default 10) of STDIN or a text file. It can also give you just the first c bytes of a file.

Usage Examples

# Handle text from Stdin
cat /path/to/file | rhead -n 20

# Handle text in a file
rhead -n 1 /etc/passwd
Usage: rhead [OPTIONS] [FILE]

Arguments:
  [FILE]  The file to read from (optional)

Options:
  -n, --number <NUMBER>  The number of lines to print [default: 10]
  -c, --chars <CHARS>    The number of characters to print (optional) [default: 0]
  -h, --help             Print help
  -V, --version          Print version

Limitations

Input data stream or input file MUST be valid UTF-8 otherwise it will be rejected. However, it is possible to output invalid UTF-8 data with -c because it operates on arbitrary number of bytes.

About

Rust clone of "head" command line utility

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published