Skip to content

Instantly share code, notes, and snippets.

@aausch aausch/recursive_touch.py
Last active Dec 23, 2015

Embed
What would you like to do?
Python script for running touch on a list of directories, and their contents
#!/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
You can’t perform that action at this time.