It's install from the GNU Coreutils
You might think it's a strange choice, boring even. I mean, all it does is copy some files around, right?
Versatility
install can just copy files around, like so:
But it can also specify the mode and ownership of the destination:
And it can create parent directories as needed:
Oh, and the source can be /dev/stdin:
|
This can be quite useful for scripting file installs:
|
|
For a sillier example, the
tinaries Makefile
directs NASM output to /dev/stdout, which is then piped
into install, skipping an intermediate file:
|
You can also install empty files by using /dev/null as the source:
Furthermore, you can install many sources to a maybe-nonexistent destination directory like so:
Flaws
As amazing as install is to use, it's not without its flaws. I wish I could
install the same source file to multiple destinations in a single invocation,
with something like the following:
install also cannot handle recursively copying directories. For this, I still
prefer mkdir -pv /path/to/dest and cp -afv /sources/source -T /path/to/dest.
Despite these hiccups, however, install is still an incredibly convenient
utility for explicit, predictable file installs.
Honorable mentions
While this really wasn't close, there are several other commands I particularly
love. Among these are
git,
curl,
fd, and
rg.
All of the above are a joy to use, and commonplace in my workflow.