- 论坛徽章:
- 0
|
原帖由 susbin 于 2008-3-19 00:51 发表 ![]()
You might have two tar installed, the Solaris tar and the GNU tar.
Make suer you use the same tar command to create/extract.
root@t7100 # uname -a
SunOS t7100 5.10 Generic_127111-02 sun4u sparc SUNW,A70
root@t7100 # which cpio
/usr/bin/cpio
root@t7100 # which tar
/usr/sbin/tar
root@t7100 # cd /soft/License/
root@t7100 # ls -l
total 17283
-r--r--r-- 1 root root 8848543 Jun 12 2007 819-0764-10_SLA_Multi.pdf
root@t7100 # find . -print | cpio -ov > /test.cpio
.
819-0764-10_SLA_Multi.pdf
17296 blocks
root@t7100 # ls -l /test.cpio
-rw-r--r-- 1 root root 8855552 Mar 24 10:23 /test.cpio
root@t7100 # ftp 10.0.25.150
Connected to 10.0.25.150.
220 rac01 FTP server ready.
Name (10.0.25.150:root):
331 Password required for root.
Password:
230 User root logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/" is current directory.
ftp> bin
200 Type set to I.
ftp> put /test.cpio
200 PORT command successful.
150 Opening BINARY mode data connection for /test.cpio.
226 Transfer complete.
local: /test.cpio remote: /test.cpio
8855552 bytes sent in 11 seconds (790.40 Kbytes/s)
ftp> bye
root@t7100 # file /test.cpio
/test.cpio: cpio archive - CHR (-c) header
-bash-3.00# uname -a
SunOS rac01 5.10 Generic_118855-33 i86pc i386 i86pc
-bash-3.00# which cpio
/usr/bin/cpio
-bash-3.00# which tar
/usr/sbin/tar
-bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
pcn1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.0.25.150 netmask ffff0000 broadcast 10.0.255.255
ether 0:c:29:72:55:83
-bash-3.00# pwd
/
-bash-3.00# ls -l /test.cpio
-rw-r--r-- 1 root root 8855552 Mar 24 10:07 /test.cpio
-bash-3.00# mkdir /test
-bash-3.00# cd /test
-bash-3.00# cpio -idmv < /test.cpio
cpio: Not a cpio file, bad header.
1 errors
-bash-3.00#
-bash-3.00# file /test.cpio
/test.cpio: byte-swapped cpio archive
[ 本帖最后由 beijing3721 于 2008-3-24 10:21 编辑 ] |
|