INSTALL(1)

πŸ“¦ version 1.053, in alpine 3.24

πŸ’– 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 .old extension. cute, non-destructive, we love to see it πŸ’–
  • -C β€” copies the file only if it actually differs from the target (and it checks with cmp). 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 and install will 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 to mkdir -p). when creating those parent directories, the implied directories are created with the default creation mask 0755 (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 BSD install(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 of install. 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 the PerlPowerTools::SymbolicMode module for the details on acceptable symbolic modes. the default mode (used in absence of -m) is 0755.
when you're specifying a symbolic mode, keep in mind that all directories are created with the default creation mask 0755 (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 β€” invokes strip(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 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