GNU Parallel

PREAMBLE

Tutorial expresses the author's subjective ideas and conform to AAL license.


Description

Use all cores of your cpu in resourceful tasks like grep, find and others when process big amount of data.


Intro

First of all, get a big chunk of data to manipulate it somehow.


Next Level

Download latest GNU Parallel in directory where we will install it from sources

$ tar xjfv parallel-latest.tar.bz2

$ cd parallel-*

$ ./configure

$ make

And in same directory

# make install

To remove application from system, in directory where you build it, do:

# make uninstall


Now, navigate to directory with "flushed data",  open any TXT file, choose any name account you like and remember it or write it elsewhere to not forget, open terminal application and write next (I assume that you already navigated by cd in that directory). After typing each command compare output.

$ find . -iname "*.txt" | grep -rin "scott" .

$ find . -iname "*.txt" | grep -rin "scott@heiferman.com" .

$ time find . -iname "*.txt" | grep -rin "scott" .

$ time find . -iname "*.txt" | grep -rin "scott@heiferman.com" .

$ time find . -iname "*.txt" | parallel grep -rin "scott@heiferman.com" .

Somehow that!



Last thoughts

Be shure that I will update tutorial in the future. So, stay on tune. And, in case it was useful, share please with your fellows or comment something regarded the subject.

For donations use that link.

Comments