# Using LiveGrep for Fast Searching of text across Terabytes of Data

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1703051286146/7ebcb29a-de75-495f-8c99-03320d43d3c6.gif)

> **Contents:**  
> 1\. [Introduction](#65d6)  
> 2\. [Working](#83a8)  
> 3\. [Procedure](#777f)

Working with massive amounts of data every day now entails a lot of searching, sorting, and analyzing data. As a result, there are numerous techniques for automating such tasks, but they are inefficient when dealing with massive amounts of data ( BIG DATA you can say). So we used another method to solve this problem - [**LIVEGREP**](https://livegrep.com/search/linux)

**👉 *Livegrep is a web-based regex search tool for large Github repositories. Essentially, Livegrep uses the indexing method, which makes searching for any word or character more efficient and simple.***

**Working of Livegrep**:-

*   It uses the concept of [**suffix array**](https://en.wikipedia.org/wiki/Suffix_array)**.**
*   When searching the suffix array, Livegrep will use a combination of strategies to narrow down the corpus matches. This includes range searches (for example, if your regex begins with \[a-f\]) and chained searches (for narrowing down a regular expression that has a common prefix).
*   Once the initial matches are found, it searches for items that truly match the query using the **RE2 regex library** (created by Russ Cox). The user is then presented with the results.

**👉 *This blog will teach you how to use/run Livegrep with Docker.***

**Follow the below steps:-**

1.  To begin, use the following command to connect to a local system/server(cloud)/Dockerhub and determine whether the container is running or not.

*   **$ docker ps -a**

2\. In case the container is running, use the below commands:

*   **$ docker stop container\_id**

3\. Run the following commands to start Livegrep using docker:

*   **$ docker run -v $(pwd):/data ghcr.io/livegrep/livegrep/indexer /livegrep/bin/livegrep-github-reindex -repo Heet-Doshi/ipcsection -http -dir /data**

\[Note: Here I have provided my personal GitHub repository\]

*   **docker network create ipc**

\[Note: you can provide any name to the network. Here I have used ipc\]

*   **$ docker run -d — rm -v $(pwd):/data — network ipc — name livegrep-backend ghcr.io/livegrep/livegrep/base /livegrep/bin/codesearch -load\_index /data/livegrep.idx -grpc 0.0.0.0:9999**
*   **$ docker run -d — rm — network ipc — publish 0.0.0.0:8910:8910 ghcr.io/livegrep/livegrep/base /livegrep/bin/livegrep -docroot /livegrep/web -listen=0.0.0.0:8910 — connect livegrep-backend:9999**

You can run the livegrep repository and search for any word or character by following the steps outlined above.

> I hope this article was informative and provided you with the details you required. If you have any questions while reading the blog, message me on [Instagram](https://www.instagram.com/acanubhav94/) or [LinkedIn](https://www.linkedin.com/in/anubhav-chaturvedi-a7465a72/).

> Thank You…
