9 releases (1 stable)
1.0.0 | Oct 15, 2020 |
---|---|
0.5.2 | Jul 25, 2019 |
0.4.1 | Jun 6, 2019 |
0.3.0 | Jun 6, 2019 |
0.1.0 | Jun 4, 2019 |
#148 in #command-line-utilities
29 downloads per month
12KB
223 lines
extra-utils
This repository contains some handy command line utilities that aren't included in the GNU coreutils. They follow the UNIX philosophy.
A lot of the tools here already exist in other languages/packages. The purpose of this project is more for fun/learning than it is for actual innovation or utility.
Installation
cargo install extra-utils
Commands
se
A simple HTTP server that serves a static folder
Usage: se [port] [folder]
The default port is 3000 and the default folder is .
(current folder)
If only one argument is provided, its purpose will be inferred:
se build
will serve the "build" folder on port 3000 and:
se 8080
will serve the current folder on port 8080.
If the requested file doesn't exist, se
will attempt to fallback to
{folder}/404.html
. Failing that, it will return HTTP 404
with an empty body.
ts
Prepend a timestamp to each line in STDIN
Usage: your_command | ts [format]
The default format is "[%Y-%m-%d %H:%M:%S]"
nth
Select the nth line(s) from STDIN
Usage: your_command | nth <start> [end]
Where start
is the starting line to print, and end
is the optional end index to
print. If end
is omitted or is less than start
, only the start
'th line will be
printed
nr
Prepend line line numbers to STDIN
Usage: your_command | nr [minwidth] [offset]
minwidth
is the minimum width of the number column. Default: 0
offset
is the starting index of the line numbers. Default: 1
Dependencies
~6MB
~103K SLoC