Chinaunix

标题: 三个小问题 [打印本页]

作者: lonelywing    时间: 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??
作者: linuxbao3    时间: 2005-10-18 18:45
标题: 三个小问题
1 mv -p /usr/* /mnt
   cp -r /usr/* /mnt

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

3 http://freebsd.org/gnome
作者: 剑心通明    时间: 2005-10-18 18:48
标题: 三个小问题
1:我是cp -R /usr/* /mnt/
作者: 剑心通明    时间: 2005-10-18 18:49
标题: 三个小问题
[quote]原帖由 "剑心通明"]1:我是cp -R /usr/* /mnt/[/quote 发表:
实验了一下,cp -R /usr/* /mnt即可
作者: 剑心通明    时间: 2005-10-18 18:50
标题: 三个小问题
2:你更新的不对吧?
3:可以用portupgrade
作者: linuxbao3    时间: 2005-10-18 18:51
标题: 三个小问题
回通明,cp -R 是指的把属性一块带过去。比如说,一个文件是属于bao3的,然后你以root身份执行 cp ,这样的话,这个文件就是属于root的了。但是如果你用cp -R,那么这个文件就还是属于bao3的。

希望没说错,以前在书上看的
作者: 剑心通明    时间: 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.
作者: 剑心通明    时间: 2005-10-18 19:05
标题: 三个小问题
好像就没有cp -r吧?
作者: 剑心通明    时间: 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
实验证明,你看的书上写错了,要不就是你记错了
作者: 剑心通明    时间: 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啊?
作者: congli    时间: 2005-10-18 19:22
标题: 三个小问题
3.不能用portupgrade.gnome有升级脚本,不过是2.6->;2.8->;2.10,不知道能不能直接由2.6->;2.10,建议是把2.6删除,再重新安装.
作者: daniel2000    时间: 2005-10-18 19:42
标题: 三个小问题
原帖由 "linuxbao3" 发表:
回通明,cp -R 是指的把属性一块带过去。比如说,一个文件是属于bao3的,然后你以root身份执行 cp ,这样的话,这个文件就是属于root的了。但是如果你用cp -R,那么这个文件就还是属于bao3的。

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

-p    Cause cp to preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions.

把属性一块带过去应该是
cp -Rp /usr/* /mnt
作者: daniel2000    时间: 2005-10-18 19:45
标题: 三个小问题
[quote]原帖由 "剑心通明"]好像就没有cp -r吧?[/quote 发表:

man里没有cp -r,不过好象可以用
linux的man里-r和-R都一样
作者: 剑心通明    时间: 2005-10-18 21:05
标题: 三个小问题
cp -r好像不行吧?我的怎么提示cp的语法,不让用啊
作者: 剑心通明    时间: 2005-10-18 21:07
标题: 三个小问题
原帖由 "daniel2000" 发表:

-p    Cause cp to preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions.

把属性..........
我只看了-R了,明天把所有的都看看,这些基本的命令用的大都是最基本的,其他的很少用到
作者: linuxbao3    时间: 2005-10-18 21:32
标题: 三个小问题
谢谢通明,明白了,记错了
作者: 剑心通明    时间: 2005-10-18 21:38
标题: 三个小问题
[quote]原帖由 "congli"]3.不能用portupgrade.gnome有升级脚本,不过是2.6->;2.8->;2.10,不知道能不能直接由2.6->;2.10,建议是把2.6删除,再重新安装.[/quote 发表:
不能portupgrade啊,那就只好卸载重装了
作者: hbaoy    时间: 2005-10-18 22:35
标题: 三个小问题
cp在bsd下用-r好像是没有不能用

openoffice都更新了,又为何非要去用哪个1。4呢
作者: lonelywing    时间: 2005-10-18 22:37
标题: 三个小问题
[quote]原帖由 "剑心通明"]荒躳ortupgrade啊,那就只好卸载重装了[/quote 发表:


怎么卸载啊?
pkg-delete gnome...
还是
进入/usr/ports/x11/gnome2
make deinstall??
然后怎么安装?
怎么我更新的ports数后,查看了一下/usr/ports/x11/gnome2 里的版本好象不对?是不是gnome和gnome2不一样?

还有就是第三个问题,关于openoffice的那个
我的更新方法是把/usr/share/examples/cvsup下的那个ports-supfiles拷贝到/root,然后修改里面的服务器为cvsup.FreeBSDChina.org
再执行cvsup -g -L 2 /root/ports-supfiles
应该没错吧??

另外:我用的版本是freebsd release 5.2
作者: lonelywing    时间: 2005-10-18 22:40
标题: 三个小问题
原帖由 "hbaoy" 发表:
cp在bsd下用-r好像是没有不能用

openoffice都更新了,又为何非要去用哪个1。4呢


奇怪,为什么我用-r都没什么问题啊,我用的是tcsh,不是bash,不知道跟这有没关系

openoffice更新不了,5555,ports下没有makefile文件
作者: iheaing    时间: 2005-10-18 23:22
标题: 三个小问题
# cd /usr/ports/editors/openoffice.org-2.0
# make LOCALIZED_LANG=zh-CN install clean


我前两天才安装过。不过我是用make install clean才安装成功的。
用了 Localized_lang=zh_cn 出错。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2