SHTOOL-INSTALL.TMP(1)
π SHTOOL-INSTALL.TMP β the manual, but make it cute π
okay bestie, gather round, because this is the shtool-install page from the GNU Portable Shell Tool and honestly? it ate. it's the install(1) command, but portable, and we're gonna go through it together, no skips, no skimming. π«Ά
β¨ NAME β¨
shtool-install β the GNU shtool install(1) command, but make it portable π
π¦ SYNOPSIS π¦
shtool install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]
[-C|--compare-copy] [-s|--strip] [-m|--mode mode] [-o|--owner owner]
[-g|--group group] [-e|--exec sed-cmd] file [file ...] path
like yes, that's a lot of flags. you'll be fine. breathe. πΈ
π DESCRIPTION π
so the whole gig: this command installs one or more files to a given target path, and it gives you all the important options of the BSD install(1) command. the trick β the actual main character move β is that all this functionality is provided in a portable way. no cap. β¨
π OPTIONS π
these are the command line options you get, and yes we're doing all of them:
-v,--verboseβ shows you some processing information. like it's narrating its own little journey. π£οΈ-t,--traceβ turns on output of the essential shell commands that get executed. basically it tells you what it's doing under the hood, which is lowkey iconic.-d,--mkdirβ for maximum BSD compatibility, the BSDshtool install -dusage is internally mapped to theshtool mkdir -f -p -m 755command. yes bestie, it's a secret identity situation. π΅οΈ-c,--copyβ copies the file to the target path. the default is to move, so this is you choosing copy instead. π«-C,--compare-copyβ same as-c, except if the destination file already exists and is identical to the source file, no installation happens at all and the target stays untouched. it's giving "not me doing work for no reason." π-s,--stripβ this one strips program executables during the installation, seestrip(1). default is to install verbatim, so no stripping unless you ask.-m,--modemode β the file mode applied to the target, seechmod(1). setting mode to-skips this step and leaves the operating system default, which is usually based onumask(1). heads up: some file modes require superuser privileges to be set. default is0755. π-o,--ownerowner β the file owner name or id applied to the target, seechown(1). β οΈ this option requires superuser privileges to execute. default is to skip this step and leave the operating system default, which is usually based on the executing uid or the parent setuid directory.-g,--groupgroup β the file group name or id applied to the target, seechgrp(1). this option requires superuser privileges to execute to the fullest extend β otherwise, on most operating systems, your choice of group is limited. default is to skip this step and leave the operating system default, which is usually based on the executing gid or the parent setgid directory. π«-e,--execsed-cmd β you can use this one once or multiple times to apply one or moresed(1)commands to the file contents during installation. obsessed. π
π EXAMPLE π
here's the vibe in a real Makefile, bestie:
# Makefile
install:
:
shtool install -c -s -m 4755 foo $(bindir)/
shtool install -c -m 644 foo.man $(mandir)/man1/foo.1
shtool install -c -m 644 -e "s/@p@/$prefix/g" foo.conf $(etcdir)/
see how the -e one is swapping @p@ for $prefix? slay. β¨
π§ HISTORY π§
the GNU shtool install command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1997 for GNU shtool. it was prompted by portability issues in the installation procedures of OSSP libraries. a true origin story. π
π SEE ALSO π
shtool(1), umask(1), chmod(1), chown(1), chgrp(1), strip(1), sed(1).
go read them, iykyk. π¦
and that's the whole page, bestie! this one's from shtool 2.0.8, dated 18-Jul-2008 β an absolute vintage icon, still serving GNU Portable Shell Tool realness. π β¨π
π¦ where this page comes from
- debian bookworm: shtool 2.0.8-10 Β· GPL-2.0-or-later
- debian trixie: shtool 2.0.8-10 Β· GPL-2.0-or-later
- ubuntu jammy: shtool 2.0.8-10 Β· GPL-2.0-or-later
- ubuntu noble: shtool 2.0.8-10 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms