美文网首页
linux command(2015-03-09)

linux command(2015-03-09)

作者: 快没时间了 | 来源:发表于2015-03-09 21:13 被阅读24次

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解压

相关文章

网友评论

      本文标题:linux command(2015-03-09)

      本文链接:https://www.haomeiwen.com/subject/ouivxttx.html