Skip to content

Instantly share code, notes, and snippets.

@rauluranga
Created June 30, 2016 23:20
Show Gist options
  • Save rauluranga/ee1fe693a17329752f9ec069dbba47c0 to your computer and use it in GitHub Desktop.
Save rauluranga/ee1fe693a17329752f9ec069dbba47c0 to your computer and use it in GitHub Desktop.
script for moving files from subdirs to parent dir
find /TARGET_DIR/* -type d | xargs -n1 sh -c 'echo mv ${0}/* "$( dirname {0})" ";" rm -rvf ${0}' | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment