What is linux install command

install(1) — Linux man page

install [OPTION]. [-T] SOURCE DEST
install [OPTION]. SOURCE. DIRECTORY
install [OPTION]. -t DIRECTORY SOURCE.
install [OPTION]. -d DIRECTORY.

Description

This install program copies files (often just compiled) into destination locations you choose. If you want to download and install a ready-to-use package on a GNU/Linux system, you should instead be using a package manager like yum(1) or apt-get(1).

In the first three forms, copy SOURCE to DEST or multiple SOURCE(s) to the existing DIRECTORY, while setting permission modes and owner/group. In the 4th form, create all components of the given DIRECTORY(ies).

Mandatory arguments to long options are mandatory for short options too. —backup[=CONTROL] make a backup of each existing destination file -b like —backup but does not accept an argument -c (ignored) -C, —compare compare each pair of source and destination files, and in some cases, do not modify the destination at all -d, —directory treat all arguments as directory names; create all components of the specified directories -D create all leading components of DEST except the last, then copy SOURCE to DEST -g, —group=GROUP set group ownership, instead of process’ current group -m, —mode=MODE set permission mode (as in chmod), instead of rwxr-xr-x -o, —owner=OWNER set ownership (super-user only) -p, —preserve-timestamps apply access/modification times of SOURCE files to corresponding destination files -s, —strip strip symbol tables —strip-program=PROGRAM program used to strip binaries -S, —suffix=SUFFIX override the usual backup suffix -t, —target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY -T, —no-target-directory treat DEST as a normal file -v, —verbose print the name of each directory as it is created -P, —preserve-context (SELinux) preserve security context -Z, —context=CONTEXT (SELinux) set security context of files and directories —help display this help and exit —version output version information and exit

The backup suffix is ‘~’, unless set with —suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the —backup option or through the VERSION_CONTROL environment variable. Here are the values: none, off never make backups (even if —backup is given) numbered, t make numbered backups existing, nil numbered if numbered backups exist, simple otherwise simple, never always make simple backups

Author

Reporting Bugs

Copyright © 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Читайте также:  Vpn android to linux

See Also

The full documentation for install is maintained as a Texinfo manual. If the info and install programs are properly installed at your site, the command info coreutils aqinstall invocationaq

should give you access to the complete manual.

Источник

Linux Install Command Tutorial

Find out everything you need to know about the Linux install command, and much more in this detailed blog.

Linux Install Command Tutorial

List of content you will read in this article:

The install command in Linux is used to copy files to a given location and assign attributes to them. It transfers data to a designated location. As the name implies, it is not used to install applications. Depending on the distribution method, we could use apt-get, apt, yum, and other tools to download and install the software. It’s quite close to the order ‘cp’. It also gives us leverage over the properties of the destination data.

It’s mostly used to copy programs from makefiles to their final destination. It would not copy files to itself. So in this guide, you will get brief information on the Linux «install command» and its use in all Linux distros.

Linux Install Command, All Linux Distros

The install command incorporates components from various commands, including cp, chown, chmod, mkdir, and strip. It enables one to combine the functions of all of these commands into a single operation.

install [OPTION]. [-T] SOURCE DEST

install [OPTION]. SOURCE. DIRECTORY

install [OPTION]. -t DIRECTORY SOURCE.

install [OPTION]. -d DIRECTORY.

The first three types are used to copy the source to a new directory or several sources to an existing directory and set permission modes and owner/group. On the other hand, the fourth form is used to construct all of the directory’s components.

Install Option Commands

The install command provides the following option:

  • —backup[=CONTROL]: For each current destination file, this alternative generates a backup file.
  • -b: It’s similar to the «—backup» alternative, except it doesn’t need a claim.
  • -C, —compare: It’s used to compare each pair of source and destination files, and it doesn’t always change the destination.
  • -d, —directory: Both arguments would be treated as directory names if the «-d or -directory» option is defined.
  • -D: It’s used to build all of the target directory’s components before copying the source to the destination.
  • -g, —group=GROUP: It’s used to determine the size of a group’s holdings.
  • -m, —mode=MODE:Instead of rwxr-xr-x, it is used to set the authorization mode (as in chmod).
  • -o, —owner=OWNER: It’s used to specify who owns what. Just the superuser has access to it.
  • -p, —preserve-timestamps: The access time of the source file is applied to the specified file.
  • -s, —strip: The strip symbol tables are generated with it.
  • —strip-program=PROGRAM: It is used to remove the program’s binaries.
  • -S, —suffix=SUFFIX: It’s used to replace the backup suffix that’s usually used.
  • -t, —target-directory=DIRECTORY: It copies all source arguments into the designated directory.
  • -T, —no-target-directory: It’s used to handle the destination file as if it were a regular file.
  • -v, —verbose: It is used to print the directory names.
  • —preserve-context: It aims to keep the SELinux security background secure.
  • -Z: It’s used to set the SELinux protection background of the destination file, as well as the default form of each newly generated directory.
  • —help: The support manual is shown using the ‘-help’ option.
  • —version: It’s used to display the details about the edition.
  1. Using the install button, we can tailor each folder and file to our specific requirements. It’s seen like this:
Читайте также:  Linux type c hdmi

install -D /src/folder/*.txt /dest/folder

The ‘-D’ choice in the above command copies all text files from the source folder to the destination folder.

install -d /destination/newfolder

The command above will generate a new folder named ‘newfolder’ in the designated directory.

sudo install xyz.txt abc.txt Pictures

The above command copies the specified files to the ‘Pictures’ folder.

Conclusion

Many times people get confused with the install function and think it is used to install the software. Instead, it is widely used as a copy function. Different option commands can be used to execute different commands. We hope you got the complete details through our article and will use this command in your system.

Источник

What is linux install command

install [ опции ] [-s] [—strip] исходный_файл файл_назначения
install [ опции ] [-s] [—strip] исходный_файл. каталог
install [ опции ] [-d,—directory] каталог.

Опции (краткая форма):
[-b] [-c] [-D] [-g группа ] [-m режим ] [-o владелец ] [-S СУФФИКС ] [-V ] [—help] [—version] [—]

ОПИСАНИЕ

install копирует файлы, при этом устанавливая права доступа к ним и, если это возможно, их владельца и группу.

В первой из вышеуказанных форм вызова, исходный_файл копируется в файл_назначения . Во второй форме каждый из исходных_файлов копируется в заданный каталог . В последней форме вызова, создается каждый каталог (и любые недостающие родительские каталоги).

Программа install похожа на cp , но позволяет вам управлять атрибутами копируемых файлов. Обычно install используется в файлах Makefile для копирования программ в необходимые каталоги. Копирование файлов самих в себя отвергается.

ОПЦИИ

-c Игнорируется; существует для совместимости со старыми Unix версиями install . -d, —directory Создает каждый заданный каталог и все отсутствующие родительские каталоги, устанавливает владельца, группу и права доступа, как задано в командной строке или по умолчанию. Кроме того, все создаваемые при этом каталоги получают такие же права доступа. (В этом состоит отличие от версии программы install из SunOS 4.x, которая дает создаваемым каталогам права доступа, установленные по умолчанию.) -D Создавать все лидирующие компоненты (родительские каталоги) файла_назначения , за исключением последнего, затем копировать исходный_файл в файл_назначения . Данная опция полезна для первой формы вызова программы. (Новое в fileutils-4.0.) -g группа , —group= группа Задать группу устанавливаемых файлов и каталогов. По умолчанию назначается текущая группа. Группа может быть представлена как именем группы, так и ее числовым идентификатором (GID). -m режим , —mode= режим Назначить режим доступа к устанавливаемому файлу или каталогу. Параметр режим может быть либо восьмеричным числом, либо иметь символьную форму (с нулевым исходным режимом), как описано в chmod(1) . По умолчанию права доступа устанавливаются в 0755 — чтение, запись и выполнение для владельца, и чтение и выполнение для группы и остальных. -o владелец , —owner= владелец Если install имеет соответствующие привилегии (запущен из-под root), то он назначает указанного владельца устанавливаемым файлам и каталогам. По умолчанию владельцем будет root. Владелец может быть задан как именем пользователя, так и числовым идентификатором пользователя (UID). -s, —strip Вырезать таблицу символов из устанавливаемого бинарного выполняемого файла.

Читайте также:  Linux user groups wheel

ОПЦИИ РЕЗЕРВНОГО КОПИРОВАНИЯ GNU

GNU-версии таких программ как cp , mv , ln , install и patch могут, если потребуется, делать резервные копии файлов, которые будут перезаписаны, изменены или уничтожены. При желании, резервные копии файлов создаются с помощью опции -b. Как они будут называться, задает опция -V. В случае, если имя файла резервной копии создается с помощью добавления суффикса к имени исходного файла, то суффикс указывается с помощью опции -S. -b, —backup Делать резервные копии файлов, которые будут перезаписаны или удалены. -S СУФФИКС , —suffix= СУФФИКС Добавить СУФФИКС к имени файла при создании его резервной копии.

Если данная опция не задана, то суффикс можно также задать, используя переменную окружения SIMPLE_BACKUP_SUFFIX Если не задана ни опция, ни переменная, то по умолчанию используется суффикс ~. -V МЕТОД , —version-control= МЕТОД Определяет, как будут называться резервные копии файлов. Аргумент МЕТОД может принимать значения numbered (или t), existing (или nil) и never (или simple). Если данная опция не задана, то будет использовано значение переменной окружения VERSION_CONTROL . Если же не задано значение и этой переменной, то по умолчанию тип резервного копирования устанавливается в existing.

Данная опция соответствует переменной version-control в Emacs. Допустимыми значениями МЕТОД являются (допускаются однозначные сокращения): t , numbered Всегда делать нумерованные резервные копии файлов. nil , existing Делать нумерованные резервные копии файлов для файлов, которые уже их имеют и простые резервные копии для остальных файлов. never , simple Всегда делать простые резервные копии.

СТАНДАРТНЫЕ ОПЦИИ GNU

—help Выдать подсказку на стандартный вывод и успешно завершиться. —version Выдать информацию о версии на стандартный вывод и успешно завершиться. — Служит для обозначения конца списка опций.

ОКРУЖЕНИЕ

При работе обычным образом используются значения переменных LANG, LC_ALL, LC_CTYPE и LC_MESSAGES. Для версии GNU переменные SIMPLE_BACKUP_SUFFIX и VERSION_CONTROL управляют именованием файлов при резервном копировании, как описано выше.

СОВМЕСТИМОСТЬ


ЗАМЕЧАНИЯ

Данная страница описывает версию install из пакета fileutils-4.0; другие версии могут иметь небольшие отличия. Исправления и дополнения присылайте по адресу aeb@cwi.nl. Отчеты об ошибках в этой программе присылайте по адресу fileutils-bugs@gnu.ai.mit.edu.

Источник

Оцените статью
Adblock
detector