duplicate a directory in terminal code example
Example 1: mac clone directory duplicate
# Is there something special with that directory or are you really just asking how to copy directories?
# Copy recursively via CLI:
cp -R <sourcedir> <destdir>
Example 2: zip current directory mac command line
zip -r output_file.zip .
Example 3: python loop opening file from directory
basepath = "pathtodir/DataFiles/"
for filename in os.listdir(basepath):
if filename.endswith(".log"):
print(os.path.join("./DataFiles", filename))
with open(basepath + filename) as openfile:
for line in openfile:
........