Skip to content

Instantly share code, notes, and snippets.

@nicewook
Last active December 30, 2017 16:49
Show Gist options
  • Save nicewook/c25ef286ccf041c651afa02420288c01 to your computer and use it in GitHub Desktop.
Save nicewook/c25ef286ccf041c651afa02420288c01 to your computer and use it in GitHub Desktop.
#!/bin/bash
c=0; d=0; mkdir -p data${d}
for file in ./test/*
do
if [ $c -eq 10000 ]
then
d=$(( d + 1 )); c=0; mkdir -p data${d}
fi
mv "$file" data${d}/
c=$(( c + 1 ))
done
@nicewook
Copy link
Author

  1. test 폴더의 많은 파일을 10000개 단위로
  2. data0 부터 하나씩 늘리며 폴더를 만들어 넣는다

@nicewook
Copy link
Author

실행시는

  1. chmod 755 divide_files.sh
  2. ./divide_files.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment