GUN/LINUX命令之 cp mv install

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

转载于:https://www.cnblogs.com/gailuo/p/5041299.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/458564.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Tomcat - Maven plugin: 运行找不到webapp

2019独角兽企业重金招聘Python工程师标准>>> The tomcat7-maven-plugin allows running the current project as a Web application and additional <webapps> can be specified that will be simultaneously loaded into tomcat. My project is not a Web ap…

面试题3

1. 你如何理解 iOS 内存管理 1. new alloc copy retain这些对象我们都要主动的release或者 autorelease 2. 如果是类方法创建的对象,那么系统自动释放池自动在适当的 时候会帮我们 release 3. ARC xcode 自动会帮我们人工智能的添加 release autorelease 操 作 2. C语言里的数…

基于MQTT协议进行应用开发

来自&#xff1a;http://www.cnblogs.com/secondtononewe/p/6073089.html 官方协议有句如下的话来形容MQTT的设计思想&#xff1a; “It is designed for connections with remote locations where a "small code footprint" is required or the network bandwidth i…

SortedDictionaryTKey,TValue正序与反序排序及Dicttionary相关

SortedDictionary<TKey,TValue>能对字典排序 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;namespace SortDictionary {class Program{static void Main(string[] args){TestDictionarySort();…

DOS窗口的编码页从UTF-8调回GBK

2019独角兽企业重金招聘Python工程师标准>>> 之前在DOS窗口操作MySQL数据库的时候&#xff0c;将编码页从GBK设置成了UTF-8&#xff0c;解决了在DOS窗口显示MySQL数据库中的表中的中文字符出现乱码的问题。但是除此之外&#xff0c;DOS窗口显示的其他中文字符都是乱…

UIBezierPath

学习UIBezierPath画图 笔者在写本篇文章之前&#xff0c;也没有系统学习过贝塞尔曲线&#xff0c;只是曾经某一次的需求需要使用到&#xff0c;才临时百度看了一看而且使用最基本的功能。现在总算有时间停下来好好研究研究这个神奇而伟大的贝塞尔先生&#xff01; 笔者在学习时…

系统架构设计理论与原则

一、无共享架构 1、无共享架构 无共享架构是一种分布式计算架构&#xff0c;这种架构中不存在集中存储的状态&#xff0c;系统中每个节点都是独立自治的&#xff0c;整个系统中没有资源竞争&#xff0c;这种架构具有非常强的扩张性&#xff0c;目前在web应用中被广泛使用。 无共…

VS2010 教程:创建一个 WPF 应用程序 (第一节)

来自&#xff1a;https://msdn.microsoft.com/zh-cn/library/ff629048.aspx [原文发表地址] VS2010 Tutorial: Build a WPF App (Step 1) [原文发表时间] Friday, May 22, 2009 8:00 AM 这篇文章里&#xff0c;我将使用VS2010 Beta 1创建一个WPF 应用程序。并且 我将展示这个产…

js 日期星期 带农历

Weekday代码 //得到当前日期如2009年6月19日 星期五 function getDate(){ var today new Date(); var x new Array("星期日", "星期一", "星期二","星期三","星期四", "星期五","星期六"…

FMDB的使用

// // FMDBmanager.h // database // // Created by PRL on 16/10/13. // Copyright © 2016年PRL. All rights reserved. // #import <Foundation/Foundation.h> interface FMDBmanager : NSObject{ FMDatabase * _db; } (FMDBmanager *)sharedManager; //获取…

深入浅出WPF之Binding的使用(一)

from: http://www.cnblogs.com/akwwl/p/3421005.html 在WPF中Binding可以比作数据的桥梁&#xff0c;桥梁的两端分别是Binding的源&#xff08;Source&#xff09;和目标&#xff08;Target&#xff09;。 一般情况下&#xff0c;Binding源是逻辑层对象&#xff0c;Binding目…

arm处理器中a5 a8 a9,v6 v7,arm7 arm9 arm11都是依据什么来分类的【转】

转自&#xff1a;http://blog.csdn.net/maochengtao/article/details/9951131ARM处理器发展这么多年&#xff0c;有很多架构&#xff0c;很多不同的内核 架构有armv1 v2 v3 v4 v5 v6 v7 内核太多了&#xff0c;比如armv1对应的是arm1&#xff0c;armv5对应的arm9&#xff0c;ar…

前端开发一些很有用的工具

apiview.com 接口规范管理平台 restClient 谷歌浏览器接口测试工具 postman 接口测试工具 SSH Secure Shell Client 抓包工具 SSH SecureFile Transfer Client wireshark 抓包分析工具 Xshell linux远程工具 Balsamiq Mockups 原型图 visio 流程图 xmind top图 SourceCounter、…

所有的iPhone设备cell的宽度都是320,解决办法是?

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.frameCGRectMake(0, 0, SW, 44); } return self; } 自己重设一下宽度就行了

深入浅出WPF之Binding的使用(二)

from: http://www.cnblogs.com/akwwl/p/3421250.html 在上一篇中介绍了Binding的基本绑定方法&#xff0c;这一篇中我们在深入的介绍Binding的其他用法。 Binding的源也就是数据的源头&#xff0c;在日常的工作中&#xff0c;除了使用像上一篇中的Student对象作为数据源外&a…

iOS 推送

最近在研究ios的推送问题&#xff0c;遇到了一些问题&#xff0c;最终整理了一下。放在这里和大家分享APNS的推送机制首先我们看一下苹果官方给出的对ios推送机制的解释。如下图 Provider就是我们自己程序的后台服务器&#xff0c;APNS是Apple Push Notification Service的缩写…

Bash判断文件夹(目录)是否存在

1 #!/bin/bash 2 if [ -d DirName ]; then 3 echo Dir exist 4 else 5 echo Dir not exist 6 fi 转载于:https://www.cnblogs.com/imzye/p/5059031.html

iOS 加载本地html文件详细操作

webView的加载&#xff0c;如果是纯文本&#xff0c;有内部样式的话&#xff0c;简单的加载请求就可以了。如下: 这种加载简单直接&#xff0c;易操作。 如果需要加载images&#xff0c;css文件 需要把xcode的项目请求路径的位置告诉webView.代码如下&#xff1a; 这样html文件…

HDU 5573 Binary Tree 构造

Binary Tree题目连接&#xff1a; http://acm.hdu.edu.cn/showproblem.php?pid5573 Description The Old Frog King lives on the root of an infinite tree. According to the law, each node should connect to exactly two nodes on the next level, forming a full binary…

志邦橱柜坑爹,志邦橱柜大忽悠,志邦橱柜欺骗

本人实实在在经历的&#xff0c;志邦橱柜就是个大忽悠,志邦橱柜没诚信!! 志邦橱柜先骗客户下订单,在预算时低开,到真正签合同时&#xff0c;不仅仅尺寸坑你,一大堆增项都会出来,原本1.5w预算到最后签合同总价到2.2w,签合同增项高开最后志邦橱柜总价超预算非常非常离谱&#xff…