GUN/LINUX命令之 cp mv install
2015-12-12 15:21
555 查看
1. cp命令 复制copy命令的简写
SYNOPSIS
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...
cp SOURCE DEST 后者如果是目录那么源文件就复制到文件夹里面并且保持着原来的名字;如果DEST是文件名那么复制过来的文件的名字就修改成此文件名
cp source…..directory 同时复制多个源那么目标只能是目录
cp –t directory source ……. 使用-t选项可以将目标和源的位置颠倒位置
参数 -f force 如果文件名存在那就删除文件然后复制,复制的时候也不提示覆盖
-r recursive 递归复制 linux的复制命令默认是不能复制目录的,所以必须使用此参数进行目录的复制
-i 交互式提醒
-p 复制链接文件的原文件
-L derefrence 只复制原文件
-P 大写 复制链接文件还是链接,保持原有属性
-a archive 归档复制 保持文档的一切属性不变
2.mv 移动命令 用法基本和cp类似
不同点 1 重命名 mv source dest 在同一目录中重命名一个原
2 没有递归选项 操作文件或者目录都可以正常操作
3. install 不能复制目录,只能文件。复制的文件有权限,主要用于制作RPM包
SYNOPSIS
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
SYNOPSIS
cp [OPTION]... [-T] SOURCE DEST
cp [OPTION]... SOURCE... DIRECTORY
cp [OPTION]... -t DIRECTORY SOURCE...
cp SOURCE DEST 后者如果是目录那么源文件就复制到文件夹里面并且保持着原来的名字;如果DEST是文件名那么复制过来的文件的名字就修改成此文件名
cp source…..directory 同时复制多个源那么目标只能是目录
cp –t directory source ……. 使用-t选项可以将目标和源的位置颠倒位置
参数 -f force 如果文件名存在那就删除文件然后复制,复制的时候也不提示覆盖
-r recursive 递归复制 linux的复制命令默认是不能复制目录的,所以必须使用此参数进行目录的复制
-i 交互式提醒
-p 复制链接文件的原文件
-L derefrence 只复制原文件
-P 大写 复制链接文件还是链接,保持原有属性
-a archive 归档复制 保持文档的一切属性不变
2.mv 移动命令 用法基本和cp类似
不同点 1 重命名 mv source dest 在同一目录中重命名一个原
2 没有递归选项 操作文件或者目录都可以正常操作
3. install 不能复制目录,只能文件。复制的文件有权限,主要用于制作RPM包
SYNOPSIS
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
相关文章推荐
- 嵌入式 Linux开发 之 tftp
- Linux平台swift语言开发学习环境搭建
- 配置Windows,Linux双网卡互联并同时能上外网
- 在linux下解决adb devices:???????? no permission
- CentOS7 配置接口IP
- Mysql5.7在linux上安装步骤
- linux文件系统
- linux文件系统
- 20151211linux系统日常管理第五部分(scp )
- linux 下svn安装配置
- FUSE队列管理浅析
- linux下firefox安装flash插件
- centos6.5源码安装git出现expat.h: No such file or directory
- [转]Centos配置国内yum源
- Linux下Java开发环境搭建和第一个HelloWorld
- 嵌入式linux+ARM环境搭建之三机互ping
- Linux命令--链接文件的那些事
- Linux内核线程
- Linux硬链接与软链接
- Linux下autoconf和automake使用