Skip to content

Instantly share code, notes, and snippets.

@blackhalt
Created May 17, 2022 17:06
Show Gist options
  • Save blackhalt/f3e32952ab5c1577995039710b1c2d40 to your computer and use it in GitHub Desktop.
Save blackhalt/f3e32952ab5c1577995039710b1c2d40 to your computer and use it in GitHub Desktop.
Sadala datnes pa direktorijiem
#!/bin/bash
dir_size=5000
dir_name="0"
n=$((`find . -maxdepth 1 -type f | wc -l`/$dir_size+1))
for i in `seq 1 $n`;
do
mkdir -p "$dir_name$i";
find . -maxdepth 1 -type f | head -n $dir_size | xargs -i mv "{}" "$dir_name$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment