install
file managementLinux/Unix
The install command is one of the most frequently used commands in Linux/Unix-like operating systems. install Copy files and set attributes
Quick Reference
Command Name:
install
Category:
file management
Platform:
Linux/Unix
Basic Usage:
install [options] [arguments]
Common Use Cases
Syntax
install [options] source... destination
Options
Option | Description |
---|---|
-b, --backup[=CONTROL] |
Make a backup of each existing destination file |
-c |
(Ignored, for compatibility with old versions) |
-d, --directory |
Treat all arguments as directory names; create all components of the specified directories |
-D |
Create all leading components of destination except the last, then copy source to destination |
-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 command) |
--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 destination as a normal file |
-v, --verbose |
Print the name of each directory as it is created |
--help |
Display help information and exit |
--version |
Output version information and exit |
Examples
How to Use These Examples
The examples below show common ways to use the install
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
install file.txt /usr/local/bin/