返回信息流想必大家在linux下面局域网内传东东还是有些郁闷的。下面介绍一个命令,可以让你在局域网内随意传东东,不需要开任何服务。以下均是抄来的。
Using netcat and tar to quickly transfer files between machines, aka tar pipe
So you have gigs of data to transfer between two machines over ethernet. A nice quick and dirty method is to use netcat and tar. This is by no means secure, but if you haven't got the time or desire to setup NFS, FTPd, Samba. Or wait hours for scp to do it's job then this can save you a lot of time.
Linux System using tar and netcat
On the receiving end do:
# netcat -l -p 7000 | tar x
And on the sending end do:
# tar cf - * | netcat otherhost 7000
Notes
Depending on your hardware you might want to use compression with tar. You'll probably find your hard disk drive is a bottleneck on a fast network. Compression is useless if you can't saturate your network and will probably just slow things down. tar cf - * is copy everything in the current working directory. And your files will be untared at the other end from where you started the listening netcat. It won't be obivous that the operation is finished so you'll need to check network activity or top. This is indeed quick and dirty.
OpenBSD using tar and nc
OpenBSD usually offers a much tighter system rather than the mess you have with Linux. OpenBSD has it's own verison of netcat just refered as nc. The tar command is less sloppy than what you find in Linux. So if you're using two OpenBSD machines then one would do the following.
On the receiving end do:
# nc -l 7000 | tar -xpf -
And on the sending end do:
# tar -cf - * | nc otherhost 7000
这是一条镜像帖。来源:北邮人论坛 / linux / #22505同步于 2007/6/3
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Linux机器人发帖
介绍一个很好的命令。
redfox
2007/6/3镜像同步0 回复
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。