I'm back!
I've put together another quick Python script that asks the user which kind of file type they wanna search, and it write back all the file in the system with that file extension.
Not sure how much can be helpful, but it might serve as idea for anyone that wants to practice or expand it even further!
Here's the code:
import fnmatch
import os
rootPath = '/'
pattern = str(input("Which type of file You wanna search today?"))
for root, dirs, files in os.walk(rootPath):
for filename in fnmatch.filter(files, pattern):
print( os.path.join(root, filename))
I created an executable for who doesn't know how to create one (I've used pyinstaller)
Here the link for the download: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free (if this is not permitted i will remove it)
Instructions:
- Unzip the file
- Place the file_search file wherever you prefer
- Open your terminal
- Navigate into the folder where you put the script
- Run it by writing: ./file_search
- The script will ask You which kind of file type You wanna search
- Write the file type You wanna search using the following formatting: *.mp3 (change mp3 with whatever file You are looking for)
- Press Enter
- All the files with the specified extension are now listed in your terminal.
I hope this might be helpful for someone, feel free to change / expand / make yours as much as you can, and if there are any question, please let me know!
Thanks!