并行的linuxshell命令gun parallel

官方地址
http://www.gnu.org/software/parallel/

下载安装包 parallel-latest.tar.bz2

解压
tar -jxvf parallel-latest.tar.bz2

安装:老套路
configure
make -j8
make install -j16

随便找个文件,做一下并发查找试试
cat install.log.syslog |  parallel --pipe grep 'group'

输出
[root@dev-suning ~]# cat install.log.syslog |  parallel --pipe grep 'group'    
Academic tradition requires you to cite works you base your article on.
When using programs that use GNU Parallel to process data for publication
please cite:

  O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
  ;login: The USENIX Magazine, February 2011:42-47.

This helps funding further development; and it won't cost you a cent.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.

Silence the citation notice: run 'parallel --bibtex' once or use '--will-cite'.

<86>Feb  2 16:44:01 groupadd[1406]: group added to /etc/group: name=floppy, GID=19
<86>Feb  2 16:44:01 groupadd[1406]: group added to /etc/gshadow: name=floppy
<86>Feb  2 16:44:01 groupadd[1406]: new group: name=floppy, GID=19
<86>Feb  2 16:44:01 groupadd[1411]: group added to /etc/group: name=vcsa, GID=69
<86>Feb  2 16:44:01 groupadd[1411]: group added to /etc/gshadow: name=vcsa
<86>Feb  2 16:44:01 groupadd[1411]: new group: name=vcsa, GID=69
<86>Feb  2 16:44:01 groupadd[1422]: group added to /etc/group: name=utmp, GID=22
<86>Feb  2 16:44:01 groupadd[1422]: group added to /etc/gshadow: name=utmp
<86>Feb  2 16:44:01 groupadd[1422]: new group: name=utmp, GID=22
<86>Feb  2 16:44:01 groupadd[1426]: group added to /etc/group: name=utempter, GID=35
<86>Feb  2 16:44:01 groupadd[1426]: group added to /etc/gshadow: name=utempter
<86>Feb  2 16:44:01 groupadd[1426]: new group: name=utempter, GID=35
<86>Feb  2 16:44:19 groupadd[1564]: group added to /etc/group: name=cdrom, GID=11
<86>Feb  2 16:44:19 groupadd[1564]: group added to /etc/gshadow: name=cdrom
<86>Feb  2 16:44:19 groupadd[1564]: new group: name=cdrom, GID=11
<86>Feb  2 16:44:19 groupadd[1569]: group added to /etc/group: name=tape, GID=33
<86>Feb  2 16:44:19 groupadd[1569]: group added to /etc/gshadow: name=tape
<86>Feb  2 16:44:19 groupadd[1569]: new group: name=tape, GID=33
<86>Feb  2 16:44:19 groupadd[1574]: group added to /etc/group: name=dialout, GID=18
<86>Feb  2 16:44:19 groupadd[1574]: group added to /etc/gshadow: name=dialout
<86>Feb  2 16:44:19 groupadd[1574]: new group: name=dialout, GID=18
<86>Feb  2 16:44:20 groupadd[1603]: group added to /etc/group: name=saslauth, GID=76
<86>Feb  2 16:44:20 groupadd[1603]: group added to /etc/gshadow: name=saslauth
<86>Feb  2 16:44:20 groupadd[1603]: new group: name=saslauth, GID=76
<86>Feb  2 16:44:21 groupadd[1616]: group added to /etc/group: name=postdrop, GID=90
<86>Feb  2 16:44:21 groupadd[1616]: group added to /etc/gshadow: name=postdrop
<86>Feb  2 16:44:21 groupadd[1616]: new group: name=postdrop, GID=90
<86>Feb  2 16:44:21 groupadd[1620]: group added to /etc/group: name=postfix, GID=89
<86>Feb  2 16:44:21 groupadd[1620]: group added to /etc/gshadow: name=postfix
<86>Feb  2 16:44:21 groupadd[1620]: new group: name=postfix, GID=89
<86>Feb  2 16:44:21 useradd[1625]: add 'postfix' to group 'mail'
<86>Feb  2 16:44:21 useradd[1625]: add 'postfix' to shadow group 'mail'
<86>Feb  2 16:44:30 groupadd[2094]: group added to /etc/group: name=fuse, GID=499
<86>Feb  2 16:44:30 groupadd[2094]: group added to /etc/gshadow: name=fuse
<86>Feb  2 16:44:30 groupadd[2094]: new group: name=fuse, GID=499
<86>Feb  2 16:44:57 groupadd[2116]: group added to /etc/group: name=sshd, GID=74
<86>Feb  2 16:44:57 groupadd[2116]: group added to /etc/gshadow: name=sshd
<86>Feb  2 16:44:57 groupadd[2116]: new group: name=sshd, GID=74

附加阅读
想去掉版权信息,则需要执行一次
parallel --bibtex
然后输入
will cite
即可

实验的过程命令
并行的linuxshell命令gun parallel


参考文章
http://mp.weixin.qq.com/s?__biz=MjM5NDMwNjMzNA==&mid=203368206&idx=2&sn=76b4712c70803c8a94e0b2dce65e6d60&scene=2&from=timeline&isappinstalled=0#rd

你可能感兴趣的:(shell命令)