Create a gist now

Instantly share code, notes, and snippets.

A python script to recursively list all files in a given directory, newline separated
import os
import sys
def listdir(d):
if not os.path.isdir(d):
print d
for item in os.listdir(d):
listdir((d + '/' + item) if d != '/' else '/' + item)
if __name__ == '__main__':
if len(sys.argv) < 2:
print 'Usage: listall DIR'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment