linux cp指令报错:cp: -r not specified; cp: omitting directory ‘xxx‘(需要加-r递归拷贝)
如图,复制文件夹的时候报错
原因:被拷贝文件夹里还有文件夹
解决方法,加-r
递归拷贝
cp demo/ workspace/ -r
帮助文档
root@2512db9ef25a:/heop/workspace/demo/base# cp --h
Usage: cp [OPTION]... [-T] SOURCE DESTor: cp [OPTION]... SOURCE... DIRECTORYor: cp [OPTION]... -t DIRECTORY SOURCE...
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.Mandatory arguments to long options are mandatory for short options too.-a, --archive same as -dR --preserve=all--attributes-only don't copy the file data, just the attributes--backup[=CONTROL] make a backup of each existing destination file-b like --backup but does not accept an argument--copy-contents copy contents of special files when recursive-d same as --no-dereference --preserve=links-f, --force if an existing destination file cannot beopened, remove it and try again (this optionis ignored when the -n option is also used)-i, --interactive prompt before overwrite (overrides a previous -noption)-H follow command-line symbolic links in SOURCE-l, --link hard link files instead of copying-L, --dereference always follow symbolic links in SOURCE-n, --no-clobber do not overwrite an existing file (overridesa previous -i option)-P, --no-dereference never follow symbolic links in SOURCE-p same as --preserve=mode,ownership,timestamps--preserve[=ATTR_LIST] preserve the specified attributes (default:mode,ownership,timestamps), if possibleadditional attributes: context, links, xattr,all--no-preserve=ATTR_LIST don't preserve the specified attributes--parents use full source file name under DIRECTORY-R, -r, --recursive copy directories recursively--reflink[=WHEN] control clone/CoW copies. See below--remove-destination remove each existing destination file beforeattempting to open it (contrast with --force)--sparse=WHEN control creation of sparse files. See below--strip-trailing-slashes remove any trailing slashes from each SOURCEargument-s, --symbolic-link make symbolic links instead of copying-S, --suffix=SUFFIX override the usual backup suffix-t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY-T, --no-target-directory treat DEST as a normal file-u, --update copy only when the SOURCE file is newerthan the destination file or when thedestination file is missing-v, --verbose explain what is being done-x, --one-file-system stay on this file system-Z set SELinux security context of destinationfile to default type--context[=CTX] like -Z, or if CTX is specified then set theSELinux or SMACK security context to CTX--help display this help and exit--version output version information and exitBy default, sparse SOURCE files are detected by a crude heuristic and the
corresponding DEST file is made sparse as well. That is the behavior
selected by --sparse=auto. Specify --sparse=always to create a sparse DEST
file whenever the SOURCE file contains a long enough sequence of zero bytes.
Use --sparse=never to inhibit creation of sparse files.When --reflink[=always] is specified, perform a lightweight copy, where the
data blocks are copied only when modified. If this is not possible the copy
fails, or if --reflink=auto is specified, fall back to a standard copy.The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable. Here are the values:none, off never make backups (even if --backup is given)numbered, t make numbered backupsexisting, nil numbered if numbered backups exist, simple otherwisesimple, never always make simple backupsAs a special case, cp makes a backup of SOURCE when the force and backup
options are given and SOURCE and DEST are the same name for an existing,
regular file.GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report cp translation bugs to <http://translationproject.org/team/>
Full documentation at: <http://www.gnu.org/software/coreutils/cp>
or available locally via: info '(coreutils) cp invocation'
root@2512db9ef25a:/heop/workspace/demo/base#
参考文章:Linux中使用cp命令报cp:omitting directory错误
linux cp指令报错:cp: -r not specified; cp: omitting directory ‘xxx‘(需要加-r递归拷贝)相关推荐
- linux复制操作 cp: -r not specified; omitting directory XXX 错误
在Linux下复制文件的时候,当想讲一个文件复制到另一个路径下(例如复制到上层文件夹下的另一文件夹中) 那么去要指定递归查找路径并复制,即,加上参数 -r 如果不加,会报错:cp: -r not sp ...
- linux cp指令报错:cp: omitting directory ‘xxx‘(需要加-r递归拷贝)
如图,复制文件夹的时候报错 原因:被拷贝文件夹里还有文件夹 解决方法,加-r递归拷贝 cp demo/ workspace/ -r 帮助文档 root@2512db9ef25a:/heop/works ...
- linux执行sudo报错【/etc/sudo.conf is owned by uid 994, should be 0】
linux执行sudo报错[/etc/sudo.conf is owned by uid 994, should be 0] 错误描述 如下图: 案例一 案例二 解决办法: 执行命令 pkexec c ...
- Linux打开文件报错E325解决方法
提示:记得点赞加关注哦! 目录 问题描述 原因分析: 解决方案: 问题描述 提示:这里描述linux中遇到的问题: 例如:Linux打开文件报错E325解决方法 E325: ATTENTION Fou ...
- Linux安装Apache报错:Cannot find a valid baseurl for repo: base/7/x86_64解决方案
Linux安装Apache报错:Cannot find a valid baseurl for repo: base/7/x86_64解决方案 参考文章: (1)Linux安装Apache报错:Can ...
- linux 启动rabbitmq 报错:
linux 启动rabbitmq 报错: Job for rabbitmq-server.service failed because the control process exited with ...
- Linux Lernel Panic 报错解决思路
Linux Kernel Panic 报错解决思路 作为系统管理员面对server重启都起不来,那是一个相当烦躁,接显示器查看经常会碰到遇到这样的字眼"Kernel Panic" ...
- 在Linux执行命令报错”Arg list too long”的原因分析
http://www.yunweipai.com/archives/558.html 在Linux执行命令报错"Arg list too long"的原因分析 吞拿鱼手卷 于 3 ...
- linux 编译报错 not a directory,Linux常见英文报错中文翻译
Linux常见英文报错中文翻译(菜鸟必知) 1.command not found 命令没有找到 2.No such file or directory 没有这个文件或目录 3.Permission ...
- Linux常见英文报错中文翻译(菜鸟必知)
Linux常见英文报错中文翻译(菜鸟必知) 1.command not found 命令没有找到 2.No such file or directory 没有这个文件或目录 3.Permission ...
最新文章
- python3菜鸟教程-Python3 元组
- 多路I/O转接服务器——epoll
- DeepMind用ReinforcementLearning玩游戏
- ProtoBuffer的.proto文件生成c++
- 计算营业额python_ARIMA时间序列分析-----Python实例(一周销售营业额预测)
- 专家称纳米机器人未来将“入侵”人脑,让人类将获得“超能力”
- iPhone发展【一】从HelloWorld开始
- Android 工具
- java使用zxing_在Java中使用Zxing读取QRCode
- 红米note5linux刷机包_红米Note5刷机包 MIUI11
- Godot GUI探讨
- Python之统计英文字符的个数
- PHP入门-简单博客编写
- 格林尼治时间转换为本地时间
- 使用阿里巴巴EasyExcel导出的excel打不开(无法打开文件)
- access_token VS refresh_token
- 玩转外贸LinkedIn必备的三大特质,以及突破六度人脉技巧
- golang 万年历的实现代码
- 【Python】os.path.exists()的含义 及文件存在但os.path.exists()返回False的原因
- 爱奇艺qsv格式视频无损转换为MP4