Created
September 20, 2024 07:27
-
-
Save peterhel/25477ed9114f2b71e37bfef5f98696d5 to your computer and use it in GitHub Desktop.
Move all files from one folder into another with folder structure intact using `find`
This file contains hidden or 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
| find from-dir/ -name '*.txt' -exec bash -c 'export A="$(dirname {})"; mkdir -p to-dir/$A && mv {} to-dir/{}' \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment