I am trying to search (using Python/R/Unix/Bash whatever) for a list of banned words in file and folder names on my network drives. I can use TreeSize but hoping there's a way to script it so it can be automated.
Asked
Active
Viewed 43 times
1 Answers
0
As you allready mentioned it in your flags, you can just use os.walk():
import os
input_path = "c:\\"
list_of_bad_words = [bad, word, example]
for (path, dirs, files) in os.walk(input_path):
for bad_word in list_of_bad_words:
if bad_word in path: #TODO
if bad_word in dirs: #TODO
if bad_word in files: #TODO

Kai Winkler
- 89
- 9