免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 14812 | 回复: 8
打印 上一主题 下一主题

请问如何CP的时候不覆盖文件也不出现提示信息 [复制链接]

论坛徽章:
0
1 [报告]
发表于 2009-01-07 20:46 |显示全部楼层
  1. cp -i --reply=no
复制代码

论坛徽章:
0
2 [报告]
发表于 2009-01-07 20:47 |显示全部楼层
[test@erpdataserver ~]$ ll ttt/*
-rw-rw-r--  1 test test  0 Jan  7 20:41 ttt/1
-rw-rw-r--  1 test test  0 Jan  7 20:43 ttt/2
-rw-rw-r--  1 test test 47 Jan  4 08:11 ttt/file1
-rw-rw-r--  1 test test 46 Jan  4 08:11 ttt/file2
-rw-rw-r--  1 test test 47 Jan  4 08:11 ttt/file3
[test@erpdataserver ~]$ ll ttt2/*
-rw-rw-r--  1 test test  0 Jan  7 20:42 ttt2/1
-rw-rw-r--  1 test test 47 Jan  7 20:39 ttt2/file1
-rw-rw-r--  1 test test 46 Jan  7 20:39 ttt2/file2
-rw-rw-r--  1 test test 47 Jan  7 20:39 ttt2/file3
[test@erpdataserver ~]$ cp -i ttt/* ttt2 --reply=no
[test@erpdataserver ~]$ ll ttt2/*
-rw-rw-r--  1 test test  0 Jan  7 20:42 ttt2/1
-rw-rw-r--  1 test test  0 Jan  7 20:43 ttt2/2
-rw-rw-r--  1 test test 47 Jan  7 20:39 ttt2/file1
-rw-rw-r--  1 test test 46 Jan  7 20:39 ttt2/file2
-rw-rw-r--  1 test test 47 Jan  7 20:39 ttt2/file3

论坛徽章:
0
3 [报告]
发表于 2009-01-07 20:52 |显示全部楼层

回复 #7 ynchnluiti 的帖子

真的啊?什么版本,废了它吧

论坛徽章:
0
4 [报告]
发表于 2009-01-07 21:00 |显示全部楼层

回复 #9 ynchnluiti 的帖子

你版本太高了
[test@erpdataserver ~]$ cp --version
cp (coreutils) 5.2.1
Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

论坛徽章:
0
5 [报告]
发表于 2009-01-07 21:11 |显示全部楼层
估计用来作备份吧,我也用到过

论坛徽章:
0
6 [报告]
发表于 2009-01-07 21:22 |显示全部楼层

回复 #13 welcome008 的帖子

你是说什么来着?
--reply么
有yes也有no啊

论坛徽章:
0
7 [报告]
发表于 2009-01-07 22:22 |显示全部楼层

回复 #17 welcome008 的帖子

不明白,学习

论坛徽章:
0
8 [报告]
发表于 2009-01-08 08:24 |显示全部楼层
原帖由 dayan_he 于 2009-1-8 00:41 发表
我测试的也没覆盖

yes no|cp -i  a b

这个我喜欢,学习了。

论坛徽章:
0
9 [报告]
发表于 2009-01-08 08:25 |显示全部楼层

回复 #33 welcome008 的帖子

终于明白你的意思了。
原来是这个意思
谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP