简体   繁体   English

Bash复制文件夹内容,而不是文件夹

[英]Bash Copy folder content, not folder

I would like to copy the contents of a folder to another one, without copying the actual folder itself. 我想将一个文件夹的内容复制到另一个文件夹,而不复制实际的文件夹本身。 For example, in /dirA/dirB/ I have a.txt, b.txt and c.txt. 例如,在/ dirA / dirB /中,我有a.txt,b.txt和c.txt。 I would like to do: 我想要做:

cp -r /dirA/dirB/ /some/folder/

In a way that a.txt, b.txt and c.txt are in /some/folder, not in /some/folder/dirB 以某种方式a.txt,b.txt和c.txt位于/ some / folder中,而不位于/ some / folder / dirB中

cp /dirA/dirB/*.txt /some/folder

将这样做,避免使用-r选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 bash 将第一个文件从源文件夹复制到目标文件夹 - bash copy the first file form source folder to destination folder 使用python或bash通过时间戳将音频文件复制到新文件夹 - use python or bash to copy audio files by time stamp to new folder 将 HDFS Hadoop 中的最后 5 个更新文件复制到 bash 中的目标文件夹 - Copy last 5 updated files in HDFS Hadoop to target folder in bash 如果已有同名文件,如何将文件复制到文件夹(Linux BASH) - How to copy a file to a folder if there is already a file with the same name (Linux BASH) 如何将特定文件复制到特定文件夹linux bash - How to copy specific files into specific folder linux bash Bash:查找包含特定字符串的文件并将它们复制到文件夹中 - Bash: Find files containing a certain string and copy them into a folder 查找文件的模式,使用该模式创建一个文件夹,然后将文件复制到该文件夹​​中-Bash脚本 - Find pattern of the file, create a folder with that pattern and copy the files to that folder - Bash script Bash脚本,输出文件夹内容和字节大小(不使用ls) - Bash script, output folder content and bytesize without using ls 如何复制名称在centos中部分已知的aa文件夹的内容 - How to copy the content of a a folder which its name is partially known in centos 在bash中解析文件夹名称 - Parse folder name in bash
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM