Giter Site home page Giter Site logo

headtail's Introduction

headtail

head and tail simultaneously!

Backstory

Not finding an existing utility to head and tail the output, nor a good way to combine existing utilities even with the help of a couple friends of mine, we decided to make one. We ended up doing a "day of learning" session with about 50 other engineers from GitHub and collaboritively came up with a minimum viable solution that worked well!

Now it's a real utility that we keep improving. Go try it out!

Contributing

Contributions are welcome! Here are some good first issues you could look into.

Quick Start

You need to have Rust installed.

# Install latest *release* version of headtail
$ cargo install headtail
# Use it on a file - prints the first 10 and last 10 lines
$ headtail somebigfile.txt

# Pipe stdout to it - prints the first 10 and last 10 lines
$ somecommand | headtail

# Print the first 25 and last 5 lines of a file
$ headtail somebigfile.txt -H 25 -T 5

# Print the default amount of first lines, but only 3 last lines
$ headtail somebigfile.txt -T 3

# Do the default thing...but then keep tailing the file and print
# out anything new that is appended to it.
$ headtail somebigfile.txt -f

See headtail -h for a full list of command-line options.

Development

# Run locally with arguments
$ cargo run -- YOUR_ARGS_GO_HERE

# Enable debug logging
$ RUST_LOG=trace cargo run -- YOUR_ARGS_GO_HERE

# Install local development version of headtail into your ~/.cargo/bin
$ cargo install --path .

Software License

Distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See license/APACHE and license/MIT.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.