spot is a lightweight, terminal-based text search utility written in C. It allows you to search for a pattern in a file, similar to grep, with options to ignore case, highlight all matches, count occurrences, and more.
- 📌 Search for a pattern in a file
- 🔠 Ignore case while matching
- 🎯 Highlight all occurrences in a line
- 🧮 Count total matches across the file
- 🆘 Display usage/help message
- 🌈 Color-highlighted output for matched patterns
git clone https://github.com/saber-88/spot.git ~/spot
cd spot./setup.shThis script will:
- Compile the
spot.cfile usingmake - Move the resulting binary to
/usr/local/bin - Make
spotglobally accessible from your terminal
You may be asked to enter your password because moving files to /usr/local/bin requires root privileges.
✅ After installation, you can use the tool from anywhere by simply running:
spot <PATTERN> <FILENAME>spot [OPTIONS] <PATTERN> <FILENAME>| Flag | Description |
|---|---|
-i, --ignore-case |
Highlight all occurrences of pattern in a file ignoring case |
-c, --count |
Display the total number of matches instead of matching lines |
-h, --help |
Show help message and exit |
spot hello file.txtspot -i Hello file.txtspot -c hello file.txtspot -i -c hello file.txtspot -i king book.txt
11 : There were a KING with a large jaw and a queen with a plain face...
12 : there were a KING with a large jaw and a queen with a fair face...Contributions, issues, and suggestions are welcome!
- Fork the repository
- Create a new branch (
git checkout -b feature-name) - Make your changes
- Push to your branch and open a Pull Request
This project is licensed under the MIT License – see the LICENSE file for details.
Developed by Karmveer