Python script for running touch on a list of directories, and their contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# run with: python recursive_touch.py <directory_name> | |
# touches all contents of <directory_name>, and recurses into subdirectories. | |
# WARNING! don't run unless you actually intend to do all that touching. | |
# some things, should not be touched. | |
# | |
# Copyright 2013, Alex Ausch | |
# Free to use under attribution license: http://creativecommons.org/licenses/by/2.0/ca/ | |
# | |
## https://gist.github.com/aausch/6557158 | |
import os, sys, subprocess | |
for d,s,fs in os.walk(sys.argv[1]): | |
for p in (s+fs): | |
subprocess.call(["touch",os.path.join(d,p)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment