There's a few programs I wish were standard on all Unix systems by now: * tree - print directory structure * bat - cat, but actually designed for reading files. Syntax highlighting, line numbers, automatic paging. * rg - better grep * direnv - local environment variables
Moreutils – Unix tools that nobody thought to write (2012)
41–50 of 225 posts
Re: Moreutils – Unix tools that nobody thought to write (2012)
#42In fact the docs even say:
> make sponge buffer to stdout if no file is given, and use it to buffer the data from pee.
Translation, pee into a sponge!
Re: Moreutils – Unix tools that nobody thought to write (2012)
#43> sponge Why not use > file? > mispipe In bash there's PIPESTATUS for that.
Sponge lets you do a series of piped transformations on 1 or more files and overwrite the result back to the original files.
Using > things will just break.
I’m guessing this also means you can’t pipe something bigger than what your memory can hold.
Re: Moreutils – Unix tools that nobody thought to write (2012)
#44It’s discussed on stack-overflow. [0]
Someone even wrote a nodejs tool for this functionality [1], but I would rather have something written in a compiled language.
[0]: https://stackoverflow.com/questions/10574794/how-to-list-onl...
Re: Moreutils – Unix tools that nobody thought to write (2012)
#45There's a few programs I wish were standard on all Unix systems by now: * tree - print directory structure * bat - cat, but actually designed for reading files. Syntax highlighting, line numbers, automatic paging. * rg - better grep * direnv - local environment variables
Good list of things you can install to better your CLI experience, but I am not sure if I agree that they fill out missing features. Why is bat better than less? I admit to catting files for reading as much as the next guy, but I almost always have the tiniest regret that I didn’t feed it into less and kept my terminal cleaner. As for RG and AG. other than being faster, how are they better? I thought they were api co…
To grep? Not that I know, I don't think either respects POSIX grep to say nothing of GNU grep. Though the trivial usage is identical, and many basic options carry over (e.g. -C and friends).
> other than being faster, how are they better?
Way better defaults for one. `rg` defaults to being recursive, ignoring binary files, respecting various types of ignore files, not being limited to BREs, coloring, …
They also have useful convenience features like "file categories" (e.g. `-t` will expand to a bunch of predefined include glob patterns so you don't have to input them by hand, which can be tedious), or parallelism (recursive ripgrep will parallelise searches across files, with grep you have to remember to combine `find`, `xargs -P` and `grep` for that to happen).
Re: Moreutils – Unix tools that nobody thought to write (2012)
#46I wish there was a short and simple command for “list all files of a directory and no subdirectories“. ls doesn’t seem to have a switch for that kind of functionality. It’s discussed on stack-overflow. [0] Someone even wrote a nodejs tool for this functionality [1], but I would rather have something written in a compiled language. [0]: https://stackoverflow.com/questions/10574794/how-to-list-onl... [1]: https://githu…
> find . -maxdepth 1 -type f
A little clunky, but there's certainly no need to mess about in JavaScript land. If you use it often, create a shell macro.
Re: Moreutils – Unix tools that nobody thought to write (2012)
#47> sponge Why not use > file? > mispipe In bash there's PIPESTATUS for that.
There's a good Stack Overflow answer here: https://unix.stackexchange.com/questions/207919/sponge-from-...
Re: Moreutils – Unix tools that nobody thought to write (2012)
#48I wish there was a short and simple command for “list all files of a directory and no subdirectories“. ls doesn’t seem to have a switch for that kind of functionality. It’s discussed on stack-overflow. [0] Someone even wrote a nodejs tool for this functionality [1], but I would rather have something written in a compiled language. [0]: https://stackoverflow.com/questions/10574794/how-to-list-onl... [1]: https://githu…
Re: Moreutils – Unix tools that nobody thought to write (2012)
#49I wish there was a short and simple command for “list all files of a directory and no subdirectories“. ls doesn’t seem to have a switch for that kind of functionality. It’s discussed on stack-overflow. [0] Someone even wrote a nodejs tool for this functionality [1], but I would rather have something written in a compiled language. [0]: https://stackoverflow.com/questions/10574794/how-to-list-onl... [1]: https://githu…