Created
August 1, 2018 16:43
-
-
Save brianhill11/8a4526e3fe5c3d36ec0c8bf52a74e605 to your computer and use it in GitHub Desktop.
Script splits a large directory with many files into subdirectories, and makes soft links from the original files to the new split directories (for batch processing in parallel)
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
#!/bin/bash | |
i=0; | |
for f in /media/GTCoutput/*; | |
do | |
d=split_$(printf %03d $((i % 5+1))); | |
mkdir -p $d; | |
bn=$(basename "$f"); | |
ln -s "$f" "$PWD/$d/$bn"; | |
i=$((i+1)); | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment