I want to move files in a 12 directories.
Target is to move for example 30 files into directory “cpu1 cpu2 … cpu12”
i found already this:
#!/bin/bash
# outnum generates the name of the output directory
outnum=1
# n is the number of files we have moved
n=0
# Go through all JPG files in the current directory
for f in * ; do
# Create new output directory if first of new batch of 2
if $n -eq 0 ]; then
outdir=cpu$outnum
mkdir $outdir
((outnum++))
fi
# Move the file to the new subdirectory
mv "$f" "$outdir"
# Count how many we have moved to there
((n++))
# Start a new output directory if we have sent 2
$n -eq 2 ] && n=0
done
That makes 2 files / dir
but i want to stop with max 12 dirs.
so making 12 dirs and move the files over this 12 dirs.
target for al this, to execute 12 times command because i have 12 cores
Who can help me further?