免费注册 查看新帖 |

Chinaunix

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

三个小问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-10-18 18:35 |只看该作者 |倒序浏览
1、关于MV 和CP

当我要复制/usr下的所有文件和目录到另一个地方,比如/mnt时
该怎么做?


cp -r /usr/* /mnt
还是其他?

2、我把ports数更新完后,发现/usr/ports/chinese/openoffice-1.1-zh_CN下只有一个README.html,没有make文件,这样怎么安装?
顺便问一下,openoffice有没有package包可以直接下载安装啊?安装ports编译时间太长了

3、我已经安装了gnome2.6,在这样的情况下怎么更新到gnome2.10??

论坛徽章:
0
2 [报告]
发表于 2005-10-18 18:45 |只看该作者

三个小问题

1 mv -p /usr/* /mnt
   cp -r /usr/* /mnt

2 如何更新的?看下你的README

3 http://freebsd.org/gnome

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
3 [报告]
发表于 2005-10-18 18:48 |只看该作者

三个小问题

1:我是cp -R /usr/* /mnt/

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
4 [报告]
发表于 2005-10-18 18:49 |只看该作者

三个小问题

[quote]原帖由 "剑心通明"]1:我是cp -R /usr/* /mnt/[/quote 发表:
实验了一下,cp -R /usr/* /mnt即可

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
5 [报告]
发表于 2005-10-18 18:50 |只看该作者

三个小问题

2:你更新的不对吧?
3:可以用portupgrade

论坛徽章:
0
6 [报告]
发表于 2005-10-18 18:51 |只看该作者

三个小问题

回通明,cp -R 是指的把属性一块带过去。比如说,一个文件是属于bao3的,然后你以root身份执行 cp ,这样的话,这个文件就是属于root的了。但是如果你用cp -R,那么这个文件就还是属于bao3的。

希望没说错,以前在书上看的

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
7 [报告]
发表于 2005-10-18 19:04 |只看该作者

三个小问题

-R    If source_file designates a directory, cp copies the directory and
           the entire subtree connected at that point.  If the source_file
           ends in a /, the contents of the directory are copied rather than
           the directory itself.  This option also causes symbolic links to be
           copied, rather than indirected through, and for cp to create spe-
           cial files rather than copying them as normal files.  Created
           directories have the same mode as the corresponding source direc-
           tory, unmodified by the process' umask.

           Note that cp copies hard linked files as separate files.  If you
           need to preserve hard links, consider using tar(1), cpio(1), or
           pax(1) instead.

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
8 [报告]
发表于 2005-10-18 19:05 |只看该作者

三个小问题

好像就没有cp -r吧?

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
9 [报告]
发表于 2005-10-18 19:12 |只看该作者

三个小问题

原帖由 "linuxbao3" 发表:
回通明,cp -R 是指的把属性一块带过去。比如说,一个文件是属于bao3的,然后你以root身份执行 cp ,这样的话,这个文件就是属于root的了。但是如果你用cp -R,那么这个文件就还是属于bao3的。

希望没说错,以前?.........

-rw-r--r--  1 test  wheel    0 Oct 18 19:05 test1
-rw-r--r--  1 test  wheel    0 Oct 18 19:05 test2
drwxr-xr-x  2 test  wheel  512 Oct 18 19:05 test3
desktop# cp -R test1/ test2/
desktop# cd test2
desktop# ll
total 2
-rw-r--r--  1 root  wheel    0 Oct 18 19:10 test1
-rw-r--r--  1 root  wheel    0 Oct 18 19:10 test2
drwxr-xr-x  2 root  wheel  512 Oct 18 19:10 test3
实验证明,你看的书上写错了,要不就是你记错了

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
10 [报告]
发表于 2005-10-18 19:21 |只看该作者

三个小问题

-R    If source_file designates a directory, cp copies the directory and
          the entire subtree connected at that point.  If the source_file
          ends in a /, the contents of the directory are copied rather than
          the directory itself.  

如果source_file指定的是一个目录,cp将拷贝该目录以及其下的目录、文件;如果source_file以/结尾,将只拷贝该目录下的内容(目录、文件)。
This option also causes symbolic links to be
          copied, rather than indirected through, and for cp to create spe-
          cial files rather than copying them as normal files.  

符号链接拷贝过去依然还是符号链接,但是这句话如何翻译?
Created
          directories have the same mode as the corresponding source direc-
          tory, unmodified by the process' umask.

这个好像不是吧?
desktop# cd test1
desktop# ll
total 2
-rw-r--r--  1 test  wheel    0 Oct 18 19:05 test1
-rw-r--r--  1 test  wheel    0 Oct 18 19:05 test2
drwxrwxrwx  2 test  wheel  512 Oct 18 19:05 test3
lrwxr-xr-x  1 test  wheel    5 Oct 18 19:12 test4 ->; test1

desktop# cp -R test1/ test2
desktop# cd test2
desktop# ll
total 2
-rw-r--r--  1 root  wheel    0 Oct 18 19:14 test1
-rw-r--r--  1 root  wheel    0 Oct 18 19:14 test2
drwxr-xr-x  2 root  wheel  512 Oct 18 19:10 test3
lrwxr-xr-x  1 root  wheel    5 Oct 18 19:14 test4 ->; test1
test3目录拷贝过来以后照样是按照umask设置的那样变成了755啊?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP