INSTALL(1)
π INSTALL(1) β bestie edition π
okay so this is install from the User Contributed Perl Documentation section of the manual (Perl v5.42.2, if we're being specific), and it's genuinely one of those little tools that just does the thing. let's get into it π«Ά
β¨ NAME β¨
install β install files and directories. literally what it says on the tin, no notes π
πΈ SYNOPSIS πΈ
install [-bCcDps] [-g group] [-m mode] [-o owner] file1 file2
install [-bCcDps] [-g group] [-m mode] [-o owner] file ... directory
install -d [-g group] [-m mode] [-o owner] directory ...
three whole moods, pick your fighter π
π¦ DESCRIPTION π¦
so the whole vibe is: install copies files to the target path you give it, which is either file2 or directory. simple as that.
OR β and this is the plot twist β if you pass -d, install creates directories instead, and it'll also make any missing parent directories as needed, kind of like mkdir -p. main character energy honestly π
here's every option, and yes we're doing all of them:
-bβ creates a backup of an existing file before it copies over it. the way it does this is by renaming the original file so it gets a.oldextension. cute, non-destructive, we love to see it π-Cβ copies the file only if it actually differs from the target (and it checks withcmp). no wasteful copying, we respect the hustle β¨-cβ copies the file. this one exists purely for compatibility, and honestly? it's the default anyway. it's giving "i'm just here to be included" π-Dβ gives you debugging info. pass it once andinstallwill warn you about impending copies or moves. pass it more than once and it'll warn you whenever it doesn't install files because of-C. more-D= more tea π-dβ creates directories (and creates missing parent directories as needed, similar tomkdir -p). when creating those parent directories, the implied directories are created with the default creation mask0755(modified by your umask). only the directories you explicitly name on the command line take the permissions specified by-m. this behavior imitates that of BSDinstall(1). iykyk π§-fβ specifies the target's file flags, i.e.-f flags. this option is only provided for compatibility and does not affect the execution ofinstall. it's decorative. it's an accessory. it's doing nothing but looking cute π-gβ specifies the group the target file should belong to. both numeric and mnemonic group IDs are acceptable. no cap π«Ά-m MODEβ specifies the target file's mode. either octal modes or symbolic modes are acceptable. see the documentation for thePerlPowerTools::SymbolicModemodule for the details on acceptable symbolic modes. the default mode (used in absence of-m) is0755.
when you're specifying a symbolic mode, keep in mind that all directories are created with the default creation mask0755(as modified by your umask), so it's probably best to use absolute symbolic permissions (e.g."u=rwx,g=rx,o=rx") as opposed to relative symbolic permissions (e.g."ugo+x"). like, don't do the relative thing, bestie, please π
-oβ specifies the owner the target should belong to. both numeric and mnemonic user IDs are acceptable. slay π-pβ preserves modification time. this option implies-C. package deal π-sβ invokesstrip(1)on installed binaries. bye bye debug symbols π
π ENVIRONMENT π
no environment variables affect the execution of install. none. zero. the environment is not involved. it's not in the group chat. π¦
π CAVEATS π
okay this is the serious part, listen up: the combination of creating files and directories and setting their permissions is not atomic, so there are lots of possibilities for race conditions. fr fr, it's a whole thing π
if you're really concerned about this, use a umask of 77. that's the advice. that's the fix. go forth π«Ά
π AUTHOR π
the Perl implementation of install was written by Greg Bacon <gbacon@itsc.uah.edu> as part of the ADaM Project. ty for your service π«‘π
πΈ COPYRIGHT and LICENSE πΈ
Copyright 1999 UAH Information Technology and Systems Center.
this program is free and open software. you may use, copy, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same. that's the whole deal β pay it forward, bestie ππ
π₯ SEE ALSO π₯
umask(2), chmod(1), mkdir(1), chown(8), chgrp(8), strip(1)
go read those too, they're all part of the same friend group β¨
and that's the whole page!! π
β¨ this version was brought to you by perl v5.42.2, dated 2026-02-15, under INSTALL(1) β mwah, go install something iconic ππ¦π
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms