- 🔍 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.
