# ffgrep
[](https://github.com/pastor-robert/ffgrep/actions/workflows/ci.yml)
[](https://github.com/pastor-robert/ffgrep/actions/workflows/pylint.yml)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
A fast file finder and grep tool that combines the functionality of `find` and `grep` into a single command.
*Developed with assistance from Claude AI by Anthropic.*
## Overview
`ffgrep` replaces the common pattern of `find . -name '*.ext' | xargs grep pattern` with a simpler, more efficient command. It recursively searches for files matching a pattern and greps for content within those files.
## Installation
Simply clone this repository and make the script executable:
```bash
git clone https://github.com/your-username/ffgrep.git
cd ffgrep
chmod +x ffgrep.py
```
Optionally, create a symlink to use it system-wide:
```bash
ln -s $(pwd)/ffgrep.py /usr/local/bin/ffgrep
```
## Usage
```bash
./ffgrep.py [options] <regex> <targets...>
```
### Arguments
- `regex`: Regular expression pattern to search for within files
- `targets`: File patterns (e.g., "*.c", ".py") and/or directories to search
### Options
- `-i, --ignore-case`: Case insensitive search
- `-l, --line-numbers`: Show line numbers
- `-n, --filename-only`: Show only filenames that contain matches
### Examples
```bash
# Find 'main' function in all C files
./ffgrep.py main "*.c"
# Extension shorthand - .c expands to *.c
./ffgrep.py CONFIG_HIGHMEM .c
# Case-insensitive search for test functions in Python files
./ffgrep.py "def.*test" "*.py" -i
# Show line numbers for error messages in log files
./ffgrep.py error "*.log" -l
# Search multiple file types
./ffgrep.py error "*.log" "*.txt" -l
# Search in multiple directories
./ffgrep.py main "*.c" src/ tests/
# Just show filenames containing TODO comments
./ffgrep.py TODO "*.py" -n
```
## Features
- **Fast**: Uses generators to avoid loading all file paths into memory
- **Flexible**: Supports multiple file patterns and directories in a single command
- **Smart**: Extension shorthand (`.c` expands to `*.c`)
- **Powerful**: Full regex support for content search
- **Portable**: Single Python script with no external dependencies
- **Unix-friendly**: Follows Unix conventions for exit codes and output format
## Requirements
- Python 3.6+
- No external dependencies
## License
MIT License - see [LICENSE](LICENSE) file for details.
## Contributing
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
## Exit Codes
- `0`: Matches found
- `1`: No matches found or error occurred
Raw data
{
"_id": null,
"home_page": "https://github.com/pastor-robert/ffgrep",
"name": "ffgrep",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "grep find search files regex pattern matching",
"author": "Rob Adams",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/77/ca/483068d5ea3fdf7bc1c7a12f45b419f8f84b2cce66232560fd3a7da8d2cc/ffgrep-1.1.0.tar.gz",
"platform": null,
"description": "# ffgrep\n\n[](https://github.com/pastor-robert/ffgrep/actions/workflows/ci.yml)\n[](https://github.com/pastor-robert/ffgrep/actions/workflows/pylint.yml)\n[](https://www.python.org/downloads/)\n[](https://opensource.org/licenses/MIT)\n\nA fast file finder and grep tool that combines the functionality of `find` and `grep` into a single command.\n\n*Developed with assistance from Claude AI by Anthropic.*\n\n## Overview\n\n`ffgrep` replaces the common pattern of `find . -name '*.ext' | xargs grep pattern` with a simpler, more efficient command. It recursively searches for files matching a pattern and greps for content within those files.\n\n## Installation\n\nSimply clone this repository and make the script executable:\n\n```bash\ngit clone https://github.com/your-username/ffgrep.git\ncd ffgrep\nchmod +x ffgrep.py\n```\n\nOptionally, create a symlink to use it system-wide:\n\n```bash\nln -s $(pwd)/ffgrep.py /usr/local/bin/ffgrep\n```\n\n## Usage\n\n```bash\n./ffgrep.py [options] <regex> <targets...>\n```\n\n### Arguments\n\n- `regex`: Regular expression pattern to search for within files\n- `targets`: File patterns (e.g., \"*.c\", \".py\") and/or directories to search\n\n### Options\n\n- `-i, --ignore-case`: Case insensitive search\n- `-l, --line-numbers`: Show line numbers\n- `-n, --filename-only`: Show only filenames that contain matches\n\n### Examples\n\n```bash\n# Find 'main' function in all C files\n./ffgrep.py main \"*.c\"\n\n# Extension shorthand - .c expands to *.c\n./ffgrep.py CONFIG_HIGHMEM .c\n\n# Case-insensitive search for test functions in Python files\n./ffgrep.py \"def.*test\" \"*.py\" -i\n\n# Show line numbers for error messages in log files\n./ffgrep.py error \"*.log\" -l\n\n# Search multiple file types\n./ffgrep.py error \"*.log\" \"*.txt\" -l\n\n# Search in multiple directories\n./ffgrep.py main \"*.c\" src/ tests/\n\n# Just show filenames containing TODO comments\n./ffgrep.py TODO \"*.py\" -n\n```\n\n## Features\n\n- **Fast**: Uses generators to avoid loading all file paths into memory\n- **Flexible**: Supports multiple file patterns and directories in a single command\n- **Smart**: Extension shorthand (`.c` expands to `*.c`)\n- **Powerful**: Full regex support for content search\n- **Portable**: Single Python script with no external dependencies\n- **Unix-friendly**: Follows Unix conventions for exit codes and output format\n\n## Requirements\n\n- Python 3.6+\n- No external dependencies\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## Exit Codes\n\n- `0`: Matches found\n- `1`: No matches found or error occurred\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Fast file finder and grep tool - combines find and grep functionality",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/pastor-robert/ffgrep"
},
"split_keywords": [
"grep",
"find",
"search",
"files",
"regex",
"pattern",
"matching"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a2bc0062058d60fc3e96d722d8a53d40a14114bda2c4e2c5dd31fe6ae51ff343",
"md5": "3b6bb8790ffbea053dc1f4b939c9f884",
"sha256": "28f75a4fd3d621b15ee94c08b029ea00e81bd5862555735ac22e5637fc51e4b8"
},
"downloads": -1,
"filename": "ffgrep-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3b6bb8790ffbea053dc1f4b939c9f884",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5592,
"upload_time": "2025-07-22T17:51:37",
"upload_time_iso_8601": "2025-07-22T17:51:37.467915Z",
"url": "https://files.pythonhosted.org/packages/a2/bc/0062058d60fc3e96d722d8a53d40a14114bda2c4e2c5dd31fe6ae51ff343/ffgrep-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "77ca483068d5ea3fdf7bc1c7a12f45b419f8f84b2cce66232560fd3a7da8d2cc",
"md5": "998ec7a2e47f78f0901a24c0f1aa3c5d",
"sha256": "818a215a25549e0d1be015c0d96f41b412c6320aced7749ba0f73df49b118a96"
},
"downloads": -1,
"filename": "ffgrep-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "998ec7a2e47f78f0901a24c0f1aa3c5d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6434,
"upload_time": "2025-07-22T17:51:38",
"upload_time_iso_8601": "2025-07-22T17:51:38.183692Z",
"url": "https://files.pythonhosted.org/packages/77/ca/483068d5ea3fdf7bc1c7a12f45b419f8f84b2cce66232560fd3a7da8d2cc/ffgrep-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-22 17:51:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pastor-robert",
"github_project": "ffgrep",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "ffgrep"
}