Answer:
import os, sys, stat
from stat import *
command = 'find ' + sys.argv[1] + ' -name *' + sys.argv[2] + '*'
print(command)
totalFiles = os.popen(command).read()
totalFiles = totalFiles.split()
totalSize = 0
for line in totalFiles:
statinfo = os.stat(line)
if stat.S_ISREG(statinfo.st_mode):
print(line, statinfo.st_size, 'bytes')
totalSize += statinfo.st_size
else:
print(line, '...')
print('Total file size:', totalSize, 'bytes')
Explanation: