- π Search for files or directories by name
- π― Choose between exact matches or partial containment
- π Recursive search through all subdirectories
- π» Simple interactive command-line interface
- β‘ Fast scanning using native Python
os.walk()
- Make sure you are on Linux
- Confirm that Python 3 is installed
- Clone the repository:
git clone https://github.com/DelorianCS/search-script.git
cd search-script
python3 search.pyβ You can also make it a terminal command:
nano ~/.bashrc | or ~/.zshrcAdd this at the bottom:
search() { python3 /FULL/PATH/TO/search.py ; }Now you can run search in any terminal window!
The script will ask you a few questions:
Where do you want to search?:
Example:
/home/user/Downloads/
Are you looking for a file or a directory? (file/directory):
What name are you looking for?:
Just the name, without extension.
βfile.txtβ β
βfileβ β
Should the name match exactly or just contain it? (exact/contain):
After that, the search begins β and you'll see matching results printed out.
Hope you found this script useful!
Suggestions and contributions are welcome.
