0

I need to write a script that would print all files recursively in the current working directory that are bigger than 100kb.

I have experience in scripting in python and shell script and I know how to do it in a non-recursive function but I'm having trouble writing it recursively. I would be happy if anyone here could help with examples

So far I have searched the internet for answers and tried to write some scripts in python with the use of the command with open(dirpath) as cur_dir but I can't figure out how to do it recursively

Shawn
  • 47,241
  • 3
  • 26
  • 60
As22
  • 11
  • 2
  • Could you please share your approach? I know you are new in this community, but we encourage people to try the first approach, to investigate and to put some effort in their first attempts. Please share what you have tried so far, I know a lot of people will be happy to help you :D. – EnriqueBet Mar 20 '20 at 23:12
  • Hi thanks for the comment, I tried to search over the internet and wrote scripts that were basically really bad so that's why I'm not uploading any example.. – As22 Mar 20 '20 at 23:19
  • 1
    As you have tagged `bash` you can use `find . -type f -size +100KB` – Digvijay S Mar 21 '20 at 00:32
  • 1
    You may use https://stackoverflow.com/questions/2212643/python-recursive-folder-read as a reference. Add a file check and the size check and you'll get the way to recursively trace files >= 100Kb – Sharad Mar 21 '20 at 04:12
  • Hi tnx for the comments, I encounter that question but I don't see any recursion there, is it possible that recursion includes the use of a for or while loop? – As22 Mar 21 '20 at 10:49

0 Answers0