Created
March 30, 2020 15:17
-
-
Save agentcobra/e21613cfdc975a0b25ff43fe3e6373f4 to your computer and use it in GitHub Desktop.
Permet de déplacer des fichiers en créant des sous-dossiers contenant n fichiers
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
n=100; | |
cd $1 | |
p=1; | |
i=0; | |
IFS=$'\n'; | |
for file in $(ls) | |
do | |
let i++; | |
currentDir="./page_"$p | |
echo $currentDir; | |
mkdir -p $currentDir | |
echo "$file"; | |
mv "$file" $currentDir | |
if [ $(($i%$n)) -eq 0 ] | |
then | |
let p++; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment