Skip to content

Instantly share code, notes, and snippets.

@damondouglas
Created February 19, 2014 02:54
Show Gist options
  • Save damondouglas/9085236 to your computer and use it in GitHub Desktop.
Save damondouglas/9085236 to your computer and use it in GitHub Desktop.
Copy file into each subdirectory that matches a regular expression
  • somefile.txt
  • 1-dir
  • 2-dir
  • 3-dir
  • 4-dir
for d in `ls | grep "\d"` ; do cp somefile.txt "$d/somefile.txt" ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment