To move regular files with prefix part
containing a suffix, you could do:
shop -s nullglob
for file in part*.*; do
[ -f "$file" ] || continue
dir=${file%.*}
mkdir -p "$dir" && mv -i "$file" "$dir"
done
This enables Bash's shell options nullglob
to expand non-matching patterns to a null string and the
test [ -f "$file" ] || continue
skips non-regular files.
The pattern ${file%.*}
removes the suffix from the filename.
Option -p
ignores an already existing directory and -i
prompts if the file should already exist in the directory.