Skip to main content

Sane replacement for command line file search

Project description

ffind v1.6.1 - A sane replacement for command line file search

Downloads Build Status PyPI version codecov

About ffind

ffind allows quick and easy recursive search for files in the command line. Very convenient to find a file you don't know exactly where it is or how it's called in a jungle of directories.

For example, when:

  • Developing code. When it's that .js file? It was called my_feature_something_somethign.js, but not sure on which on of the 30 subdirectories it is. ffind my_feature
  • Searching for a particular funny meme. It was under Images directory, but not sure if it was a .mp4 or .gif and if it was "dancing" or "DANCE"... ffind Images/ danc

See it here in action!

Demo

If you have deal with Unix find, it replaces the cumbersome find . -name '*FILE_PATTERN*' with ffind FILE_PATTERN (plus more niceties).

Main features

  • Search recursively on current directory by default.
  • Ignores hidden and source control files and directories by default, avoiding showing files you don't care.
  • If the FILE_PATTERN is all in lowercase, the search will be case insensitive, unless a flag is set. Just write the search in lowercase to ensure maximum returns.
  • Will print colorized output in glamorous red (default), except on redirected output.
  • Can delete matched files, making very easy to clean compiled files, like .pyc or .o. Try ffind --delete pyc on your Python project

Common uses:

  • ffind txt to return all plain text files in current tree structure.
  • ffind ../other_dir txt to return all plain text files under dir ../other_dir
  • ffind --delete pyc to delete files that contain pyc. Use ffind --delete pyc$ for only files ending in pyc

But wait, there is more!

  • Input filename may be a full regex
  • Regex can affect only the filename (default) or the full path.
  • Follow symlinks by default, but that can be deactivated if necessary to avoid recursion problems
  • Works in Python3! Older versions (until v1.3.1) are also Python 2.7 compatible for legacy support
  • Can execute commands on matched files
  • Experimental fuzzy search

Install

Requires pip, the tool for installing Python packages. You already have it installed by default on Python3!

pip install ffind

All arguments

Call ffind --help to display all the available arguments.

usage: ffind.py [-h] [-p] [--nocolor] [--nosymlinks] [--hidden] [-c]  [-i]
            [--delete | --exec "command" | --module "module_name args" | --command "program"]
            [--ignore-vcs] [-f] [--version]
            [dir] filepattern

Search file name in directory tree

More information here

Environment variables

Environment variables in your shell can be used to set up default options and parameters. See here for more information.

Manual install

From the source code directory:

python setup.py install

Test

To test ffind, you must install cram (you can use pip install cram). To run all the tests, run make test. This runs the tests on both Python 2 and Python 3. Running just make runs the test for Python 3.

The tests are under the tests directory; more tests are welcome.

License

The MIT License (MIT)

Copyright (c) 2013-2022 Jaime Buelta

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ffind-1.6.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

ffind-1.6.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file ffind-1.6.1.tar.gz.

File metadata

  • Download URL: ffind-1.6.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ffind-1.6.1.tar.gz
Algorithm Hash digest
SHA256 1715b6b718eb53ec0b7e9877399b894a48ace1faa2f6a3d772376b7b0a181feb
MD5 a43ac3d4a732524c6cfa7d55bcb3c280
BLAKE2b-256 2e0397fca9e84aa4f4e484884a8ca21fd4e2d07a7906a2228044f80fa28c1a21

See more details on using hashes here.

File details

Details for the file ffind-1.6.1-py3-none-any.whl.

File metadata

  • Download URL: ffind-1.6.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ffind-1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d79c604087f53fe0e1e3dc4d75a4cf9d4a424a7143289b5f2b9ea061b9a266a
MD5 ddd593e7d088509b9141a6cda879985c
BLAKE2b-256 59ae5b13349f7f5f9977f2f3cbc26ba09098db2b1242b715a67df4fa2a75e372

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page