I’m trying to create a dashboard which can show the oldest files in a directory, files with maximum size and both old and max size. I need a python script which can find out files recursively in all possible directories under my root directory which are oldest and have maximum size. Is it possible to do this via python or you need to write a shell script/awk for this?
Share
To recursively check directories use
os.walk().Use
os.path.getsize()to get size of a file,os.path.getmtime()to get it’s modification time.