Skip to content

DelorianCS/search-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

72 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” File/Directory Search Script

Preview

Features

  • πŸ” 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()

πŸ›  Installation

  1. Make sure you are on Linux
  2. Confirm that Python 3 is installed
  3. 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 ~/.zshrc

Add this at the bottom:

search() { python3 /FULL/PATH/TO/search.py ; }

Now you can run search in any terminal window!

πŸ”§ Usage (Interactive Mode)

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.

❀️ Thanks for reading

Hope you found this script useful!
Suggestions and contributions are welcome.

About

Simple Python script to search for files or directories by name in a specified folder on Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages