So, there is another way (and it is somewhat tolerated _
(python <<EOF import fnmatch import os import os.path as path import time matches = [] def find(dirname=None, newerThan=3*24*3600, olderThan=None): for root, dirnames, filenames in os.walk(dirname or '.'): for filename in fnmatch.filter(filenames, '*'): filepath = os.path.join(root, filename) matches.append(path) ts_now = time.time() newer = ts_now - path.getmtime(filepath) < newerThan older = ts_now - path.getmtime(filepath) > newerThan if newerThan and newer or olderThan and older: print filepath for dirname in dirnames: if dirname not in ['.', '..']: print 'dir:', dirname find(dirname) find('.') EOF ) | xargs -I '{}' echo found file modified within 3 days '{}'
test30 Oct 19 '16 at 23:47 2016-10-19 23:47
source share