Created
October 2, 2016 22:05
-
-
Save ecelis/30cf5dc69e0ef1d9443aab80047194ae to your computer and use it in GitHub Desktop.
Shell oneliners
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
## Copy files in YYYY/MM/DD/filename.txt directory hierarchy to YYYY-MM-DD-filename.txt | |
find . -name '*.txt' -exec bash -c 'name="{}"; cp "${name}" ./"${name:2:4}"-"${name:7:2}"-"${name:10:2}"-"${name:13}"' \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment