linux command(2015-03-09)

1.look

用来查英文单词不错- -

look succesful

2.pv

echo "Tecmint [dot] com is the world's best website for qualitative Linux article" | pv -qL 20

放电影一样把字幕输出

3.factor

factor 1024

"The factor command is actually a command of mathematical origin. This command outputs all the factors of a given number."

4.logsave

logsave -a out.log echo "hello world"

logsave is a very nice tool that captures the output of a program and sends it too a log-file. It’s more or less the same what “tee” does, only it will add a begin time stamp and a end time stamp:

5.strace

strace -p 1725 -o output.txt

strace -c ls /home

6.nc

发送一个文件很简单,但是如果我们想要发送多个文件,或者整个目录,一样很简单,只需要使用压缩工具tar,压缩后发送压缩包。

如果你想要通过网络传输一个目录从A到B。

Server

$tar -cvf – dir_name | nc -l 1567

Client

$nc -n 172.31.100.7 1567 | tar -xvf -

这里在A服务器上,我们创建一个tar归档包并且通过-在控制台重定向它,然后使用管道,重定向给netcat,netcat可以通过网络发送它。

在客户端我们下载该压缩包通过netcat 管道然后打开文件。

如果想要节省带宽传输压缩包,我们可以使用bzip2或者其他工具压缩。

Server

$tar -cvf – dir_name| bzip2 -z | nc -l 1567

通过bzip2压缩

Client

$nc -n 172.31.100.7 1567 | bzip2 -d |tar -xvf -

使用bzip2解压

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容