Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

A python script to recursively list all files in a given directory, newline separated

View listall.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/python
import os
import sys
 
def listdir(d):
if not os.path.isdir(d):
print d
else:
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'
else:
listdir(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.