分页: 1 / 1

请大家帮忙解释一下find . -print0 | cpio -p0dm ../mnt这句命令

发表于 : 2007-06-21 12:23
smallstar
find . -print0 | cpio -p0dm ../mnt

发表于 : 2007-06-21 12:34
smallstar
find . 和 find . -print0 的区别
------------------------------------------------------------------
[root@localhost web]# find .
.
./cgi-bin
./cgi-bin/dhcp.cgi
./cgi-bin/dmz.cgi
./cgi-bin/empty.cgi
./cgi-bin/filter.cgi
./cgi-bin/hclone.cgi
./cgi-bin/passwd.cgi
./cgi-bin/pforward.cgi
./cgi-bin/setup.cgi
./cgi-bin/switcha.cgi
./cgi-bin/switch.cgi
./cgi-bin/switchi.cgi
./cgi-bin/upnp.cgi
./cgi-bin/wlan.cgi
./dhcp.html
./dhcp.html~
./dmz.html
./filter.html
./hclone.html
./icons
./icons/ks8695.jpg
./icons/micrel.jpg
./icons/dot.gif
./icons/blank.gif
./icons/booko.gif
./icons/doc2.gif
./icons/fclosed.gif
./icons/fopen.gif
./icons/globe.gif
./icons/home.gif
./icons/lastnode.gif
./icons/mlastnode.gif
./icons/mnode.gif
./icons/node.gif
./icons/plastnode.gif
./icons/pnode.gif
./icons/vertline.gif
./index.html
./layer3f.xml
./Makefile
./mibc.html
./mlBanner.html
./mlfolder.js
./MLiteBanner.html
./mlLogo.html
./mlTree.html
./passwd.html
./pforward.html
./rootDescLan.xml
./rootDescWan.xml
./setup.html
./setup.html.old
./soho.js
./switcha.html
./switch.html
./switchi.html
./upnp.html
./VLANPort.html
./wancic.xml
./wlan.html
[root@localhost web]#

------------------------------------------------------------------------------------
[root@localhost web]# find . -print0
../cgi-bin./cgi-bin/dhcp.cgi./cgi-bin/dmz.cgi./cgi-bin/empty.cgi./cgi-bin/filter.cgi./cgi-bin/hclone.cgi./cgi-bin/passwd.cgi./cgi-bin/pforward.cgi./cgi-bin/setup.cgi./cgi-bin/switcha.cgi./cgi-bin/switch.cgi./cgi-bin/switchi.cgi./cgi-bin/upnp.cgi./cgi-bin/wlan.cgi./dhcp.html./dhcp.html~./dmz.html./filter.html./hclone.html./icons./icons/ks8695.jpg./icons/micrel.jpg./icons/dot.gif./icons/blank.gif./icons/booko.gif./icons/doc2.gif./icons/fclosed.gif./icons/fopen.gif./icons/globe.gif./icons/home.gif./icons/lastnode.gif./icons/mlastnode.gif./icons/mnode.gif./icons/node.gif./icons/plastnode.gif./icons/pnode.gif./icons/vertline.gif./index.html./layer3f.xml./Makefile./mibc.html./mlBanner.html./mlfolder.js./MLiteBanner.html./mlLogo.html./mlTree.html./passwd.html./pforward.html./rootDescLan.xml./rootDescWan.xml./setup.html./setup.html.old./soho.js./switcha.html./switch.html./switchi.html./upnp.html./VLANPort.html./wancic.xml./wlan.html[root@localhost web]#
[root@localhost web]#

有人知道 -print0 参数的解释吗?

发表于 : 2007-06-21 12:42
smallstar
自己用man find 解决。^_^

-print0
True; print the full file name on the standard output, followed
by a null character. This allows file names that contain new-
lines to be correctly interpreted by programs that process the
find output.


但是cpio -p0dm 的这个参数我还是不知道什么意思。

发表于 : 2007-06-21 13:04
bones7456
cpio --help
里面说了:
-p, --pass-through Run in copy-pass mode
-0, --null A list of filenames is terminated by a null character instead of a newline
-d, --make-directories Create leading directories where needed
-m, --preserve-modification-time Retain previous file modification times when creating files

发表于 : 2007-06-21 14:14
smallstar
谢谢bones7456