Live data from Hacker News

Moreutils – Unix tools that nobody thought to write (2012)

joeyh.name

141–150 of 225 posts

Re: Moreutils – Unix tools that nobody thought to write (2012)

#141
post #124

I seriously hate this package and the manner of combining different utils with different names in a same package in general. The reason being, "sponge" is an actually useful tool and for me it's pretty much the only useful tool in the package. So I need to install whole moreutils package on ubuntu to have "sponge" and I have to clog my bin namespace with all this trash. It would be mildly annoying from the perfection…

you raise a great point. why not install the package, then delete the /usr/bin files you don't need? would it solve the problem if the author namespaced the commands with a hyphenated prefix? curious about these considerations, which it seems like you've spent time thinking about. what do you see as the "best practices" regarding a set of utilities that are maintained and published together?

Excepting the user to have to clean cruft to install the software they want is a terrible philosophy and not in line with Unix at all, now you've created a situation where to install "sponge" you need to place 10 other random binaries onto your machine and know enough about the process to know to delete them...

Re: Moreutils – Unix tools that nobody thought to write (2012)

#142
post #15

Nice collection of quite useful tools. Some of these can be easily replicated by using a more modern shell (bash, zsh) like mispipe, others are just shortcuts (e.g. ifne, chronic). But what immediately stood out to me is `vidir`. I really like the idea of editing file names with an editor. Using loops and regex in a shell for mass renaming can be a mess. It should be way easier with `vim`. This tool made me install m…

you might also be interested in vimv and vimcp

https://github.com/thameera/vimv

https://github.com/danieldugas/vimcp

Re: Moreutils – Unix tools that nobody thought to write (2012)

#143

I 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…

The are two main responses to this comment as I write this. One of them lists only regular files. One of them lists anything that isn't a directory. And that's why there isn't a short and simple command.

Re: Moreutils – Unix tools that nobody thought to write (2012)

#144
post #31

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

> tree

I agree, tree is great. It can be somehow replicated by using "find .", if you are in a hurry.

> bat

If you need that functionality, why don't you open the file with vim, for example?

> rg - better grep

Grep is pretty nifty, I don't see how could it be improved. What is the main advantage of of rg over grep?

> direnv - local environment variables

I read the manpage for direnv and I was really scared. What is it for? I never used an .envr. If I need to see my environment I can simply use "env". What is it missing?

Re: Moreutils – Unix tools that nobody thought to write (2012)

#145
post #124

I seriously hate this package and the manner of combining different utils with different names in a same package in general. The reason being, "sponge" is an actually useful tool and for me it's pretty much the only useful tool in the package. So I need to install whole moreutils package on ubuntu to have "sponge" and I have to clog my bin namespace with all this trash. It would be mildly annoying from the perfection…

Is there a way to namespace on install? Or does that have to be configured in the package?

Docker

Re: Moreutils – Unix tools that nobody thought to write (2012)

#146
post #70
post #27

Earlier quoted context omitted.

On most POSIX systems you can use fc(1) to edit a command in your $EDITOR. In vi(1) and friends you can then use "%!ls" to replace the contents of the buffer with directory listing and edit the commands you want. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/f... https://pubs.opengroup.org/onlinepubs/9699919799/utilities/v...

> you can then use "%!ls" to replace the contents of the buffer with directory listing and edit the commands you want. I often used :r !ls for that, thanks for the tip + it's shorter

Note that in general this is not a one-to-one replacement. `%!cmd` sends the current buffer contents to `cmd`’s stdin and replaces the buffer with `cmd`’s output. In the case of ‘ls’ this works since it doesn’t take anything on stdin

Re: Moreutils – Unix tools that nobody thought to write (2012)

#147

Earlier quoted context omitted.

It's one of the reasons I like using the nnn file manager. It has a batch rename feature with exactly that functionality.

+1 for the powerful yet minimalistic nnn where concise help is only a question mark away and the default mnemonics make sense. Wonderful piece of software.

Honestly one of the most well maintained projects I’ve ever used. The author has a coherent “philosophy” and vision of how the program should work and does a good job of preventing feature/scope creep. Don’t see that too often

Re: Moreutils – Unix tools that nobody thought to write (2012)

#148
post #124

I seriously hate this package and the manner of combining different utils with different names in a same package in general. The reason being, "sponge" is an actually useful tool and for me it's pretty much the only useful tool in the package. So I need to install whole moreutils package on ubuntu to have "sponge" and I have to clog my bin namespace with all this trash. It would be mildly annoying from the perfection…

Is there a way to namespace on install? Or does that have to be configured in the package?

You put them in different directories, e.g. Solaris-style /opt/package/…, and arrange your PATH accordingly.

Re: Moreutils – Unix tools that nobody thought to write (2012)

#149
post #31

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

> tree I agree, tree is great. It can be somehow replicated by using "find .", if you are in a hurry. > bat If you need that functionality, why don't you open the file with vim, for example? > rg - better grep Grep is pretty nifty, I don't see how could it be improved. What is the main advantage of of rg over grep? > direnv - local environment variables I read the manpage for direnv and I was really scared. What is i…

Re: bat. I agree with you, I don’t get the hype over this program either. It’s pretty easy to configure 'less’ to use syntax highlighting and ‘less’ is installed basically everywhere.

The main advantage of rg is how much faster it is than grep. It’s WAY faster.

I don’t use direnv but I have colleagues who do. I think the idea is that it can set environment variables/run arbitrary commands when you cd into a certain directory (such as activating a Python virtual env, for instance).

Post reply on HN