bash copy multi files

# copy one file
$ cp file1.js /var/www/html # copy multi files ??? no space
$ cp file1.js,file2.js /var/www/html # space error
$ cp file1.js file2.js /var/www/html

macOS zsh ???

$ cp file1.js file2.js folder

$ cp /home/usr/dir/{file1,file2,file3,file4} /home/usr/destination/

$ cp /home/folder/{file1,file2} /home/destination/

https://askubuntu.com/questions/327282/copying-multiple-specific-files-from-one-folder-to-another

https://stackoverflow.com/questions/24206349/copy-multiple-files-from-one-directory-to-another-from-linux-shell

for loop

# test
$ for file in ABC.*; do echo cp "$file" "${file/ABC/DEF}";done # copy
$ for file in ABC.*; do cp "$file" "${file/ABC/DEF}";done

https://unix.stackexchange.com/questions/122605/how-do-i-copy-multiple-files-by-wildcard

var

f1="/somedir/a file.png"
︙
f2="/somedir/another file.png"
︙
$ cp "$f1" "$f2" "$f3" … /someotherdir

https://superuser.com/questions/557166/copy-multiple-files-via-cp-from-a-string

cd

$  cd ~
$ cd .
$ cd /

refs

Dockerfile

https://github.com/xgqfrms/nginx-image/blob/main/Dockerfile

FROM ubuntu
MAINTAINER admin@xyqfrms.xyz
RUN apt-get update
RUN apt-get install -y nginx
# COPY index.html app.js /var/www/html
COPY index.html /var/www/html
ENTRYPOINT ["usr/sbin/nginx", "-g", "daemon off;"]
EXPOSE 80

https://github.com/xgqfrms/nginx-image/issues/4#issuecomment-751676953

/usr/share/nginx/html

/var/www/html



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


bash copy multi files的更多相关文章

  1. -bash: ulimit: open files: cannot modify limit: Operation not permitted

    普通用户登录系统报错,提示: -bash: ulimit: open files: cannot modify limit: Operation not permitted. 处理方法: #vi /e ...

  2. Win7-U盘安装出现"We were unable to copy your files. "

    使用Windows 7 USB/DVD Download Tool时,提示We were unable to copy your files. Please check your USB device ...

  3. API Copy Big FIles

    public class ApiCopyFile { private const int FO_COPY = 0x0002; private const int FOF_ALLOWUNDO = 0x0 ...

  4. Save results to different files when executing multi SQL statements in DB Query Analyzer 7.01

        1 About DB Query Analyzer DB Query Analyzer is presented by Master Genfeng,Ma from Chinese Mainl ...

  5. bash guide

    Table of Contents Basic Operations 1.1. File Operations 1.2. Text Operations 1.3. Directory Operatio ...

  6. man bash

    BASH(1) General Commands Manual BASH(1) NAME bash - GNU Bourne-Again SHell SYNOPSIS bash [options] [ ...

  7. 从源码角度谈谈MySQL "Too many open files"错误的根本原因

    "Too many open files"是一个比较常见的错误,不仅仅是在 MySQL 中.只要是在 Linux 中启动的进程,都有可能遇到这个错误. 究其原因,是进程打开的文件描 ...

  8. bash的配置

    Bash的启动文件 启动文件也是一种脚本,不过它是在Bash在启动之初就执行它的.不同的启动方式使用的启动文件也有不同. 1. 作为交互的登录脚本环境“交互的”是指你可以再这个环境下输入命令.而所谓的 ...

  9. JAVA基础知识之NIO.2——Path,Paths,Files

    NIO.2 JDK7对NIO进行了重大改进,主要包含以下两方面 新增Path接口,Paths工具类,Files工具类. 这些接口和工具类对NIO中的功能进行了高度封装,大大简化了文件系统的IO编程. ...

随机推荐

  1. 05. struts2中为Action属性注入值

    概述 struts2为Action中的属性提供了依赖注入功能 在struts2的配置文件中,我们可以很方便地为Action中的属性注入值.注意:属性必须提供get,set方法. 配置 <acti ...

  2. Hive常用日期格式转换

    固定日期转换成时间戳 select unix_timestamp('2016-08-16','yyyy-MM-dd') --1471276800 select unix_timestamp('2016 ...

  3. TCP报文段的首部格式 20字节的固定首部

    <----  IP首部 TCP首部 TCP报文段的数据部分  <---- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ...

  4. How to Gracefully Close Channels

    小结: 1. When a goroutine sends a value to a channel, we can view the goroutine releases the ownership ...

  5. 服务器端IO模型的简单介绍及实现 阻塞 / 非阻塞 VS 同步 / 异步 内核实现的拷贝效率

    小结: 1.在多线程的基础上,可以考虑使用"线程池"或"连接池","线程池"旨在减少创建和销毁线程的频率,其维持一定合理数量的线程,并让空闲 ...

  6. 11.15 gryz校测(题解分析报告)

    T1 心有灵犀 (cooperate) 题目大意 给你一个不超过 \(10^9\) 的数字 \(n\) 和一个交换次数上限 \(k\), 每次操作对这个 数字 \(n\) 的其中两位进行交换, 比如 ...

  7. NOI Linux 快速入门指南

    目录 关于安装 NOI Linux 系统配置 网络 输入法 编辑器 1. gedit 打开 配置 外观展示 2. vim 打开 配置 使用 makefile 编译运行 1. 编写 makefile 2 ...

  8. 最简单直接地理解Java软件设计原则之单一职责原则

    理论性知识 定义 单一职责原则, Single responsibility principle (SRP): 一个类,接口,方法只负责一项职责: 不要存在多余一个导致类变更的原因: 优点 降低类的复 ...

  9. 十:SpringBoot-配置AOP切面编程,解决日志记录业务

    SpringBoot-配置AOP切面编程,解决日志记录业务 1.AOP切面编程 1.1 AOP编程特点 1.2 AOP中术语和图解 2.SpringBoot整合AOP 2.1 核心依赖 2.2 编写日 ...

  10. linux 系统磁盘管理(主分区和逻辑分区)

    摘要:linux系统磁盘管理主分区和逻辑分区 1.linux系统分区应了解的常识 硬盘分区实质上是对硬盘的一种格式化,然后才能使用硬盘保存各种信息,在创建分区时,就已经设置好了硬盘的各项物理参数,指定 ...