INSTALL(1,C) AIX Commands Reference INSTALL(1,C) ------------------------------------------------------------------------------- install PURPOSE Installs a command. SYNTAX +----------------+ +------------------+ +-------+ /etc/install ---| |---| +--------------+ |-- file --| |--| +- -n directory -+ +-| -d mode |-+ +- dir -+ ^| -h component || ^ | || -i || +-----+ || -m || || -o || || -s || || -v fstore || || -H || || -M mode || || -O owner || || -G group || || -S || |+--------------+| +----------------+ +- -c directory ----------+ +------------------+ /etc/install ---| +------+ |---| +--------------+ |-- file --| +- -f directory -| |-+ | | -d mode | | +- -o -+ +-| -h component |-+ ^| -m || || -s || || -v fstore || || -H || || -M mode || || -O owner || || -G group || || -S || |+--------------+| +----------------+ DESCRIPTION The install command installs a file in a specific place within a file system. It is most often used in makefiles (see "make"). When replacing files, the install command copies each file into the appropriate directory, thereby retaining the original owner and permissions. A newly created file has permission code 755, owner bin, and group bin. The install command writes a Processed March 8, 1991 INSTALL(1,C) 1 INSTALL(1,C) AIX Commands Reference INSTALL(1,C) message telling you exactly which files it is replacing or creating and where they are going. If you do not supply any arguments, the install command searches a set of default directories (/bin, /usr/bin, /etc, /lib, and /usr/lib, in that order) for a file with the same name as file. The first time it finds one, it overwrites it with file and issues a message indicating that it has done so. If no match is found, the install command issues a message telling you there was no match and exits with no further action. If any directories are specified on the command line, the install command searches them before it searches the default directories. Note: When you use install, it creates a hidden directory. To remove the files you have installed, use the rm -rf command. FLAGS -c directory Installs a new command file in directory only if that file does not already exist. If it finds a copy of file (as a regular file, directory or hidden file), it issues a message and exits without overwriting the file. -d mode Specify permission mode for installed hidden directories. -f directory Forces installation of file in directory regardless of whether file already exists. If the file being installed does not already exist, the install command sets the permission code and owner of the new file to 755 and bin, respectively. -G group This option may be used to specify a different group for the destination file. The group may be either a decimal group ID or a group name. The default group is bin. -h component Use or create a hidden directory with the specified component. The component is that of the machine on which install is invoked. -H Suppresses creation of a hidden directory. -i Ignores the default directory list and searches only those directories specified on the command line. This flag cannot be used with the -c or -f flag. -m The file is moved to the directory not copied. -M mode This option may be used to specify the octal mode of the destination file. -n directory Installs file in directory if it is not in any of the searched directories and sets the permissions and owner of the file to 755 and bin, respectively. This flag cannot be used with the -c Processed March 8, 1991 INSTALL(1,C) 2 INSTALL(1,C) AIX Commands Reference INSTALL(1,C) or -f. If the file is found in one of the searched directories, install places the file in the directory in which it was found. -o Saves the old copy of file by copying it to OLDfile in the directory in which it was found. This flag cannot be used with the -c flag. -O owner This option may be used to specify a different owner of the destination file. The owner may be either a decimal user ID or a user name. The default owner is bin. -s Suppresses display of all but error messages. -S Strip the symbol table out of the installed executable file. -v fstore Specify the fstore value for the installed file. (See the chfstore command.) EXAMPLES 1. To replace a command that already exists in one of the default directories: /etc/install fixit This command replaces "fixit" if it is found in the directory /bin, /usr/bin, /etc, /lib, or /usr/lib. Otherwise, it is not installed. For example, if "/usr/bin/fixit" exists, this file is replaced by a copy of the file "fixit" in the current directory. 2. To replace a command that already exists in a specified or default directory, and to preserve the old version of: /etc/install -o fixit /etc /usr/games This command replaces "fixit" if found in /etc, /usr/games, or one of the default directories. Otherwise it is not installed. If "fixit" is replaced, the old version is preserved by renaming it OLD"fixit" in the directory in which it was found (-o). 3. To replace a command that already exists in a specified directory: /etc/install -i fixit /u/tom/bin /u/joan/bin /usr/games This command replaces "fixit" if found in the directory /u/tom/bin, /u/joan/bin, or /usr/games. Otherwise, it is not installed. 4. To replace a command if found in a default directory, or install it in a specified directory if not found: /etc/install -n /usr/bin fixit Processed March 8, 1991 INSTALL(1,C) 3 INSTALL(1,C) AIX Commands Reference INSTALL(1,C) This command replaces "fixit" if found in one of the default directories. If "fixit" is not found, it is installed as "/usr/bin/fixit" (-n /usr/bin). 5. To install a new command: /etc/install -c /usr/bin fixit This command creates a new command by installing a copy of "fixit" as Processed March 8, 1991 INSTALL(1,C) 4