So I followed solution here: Script to create folder with same name as file and move file into folder. I want to create folder with same name as file in a folder, and move them into that folder.
for file in *; do if [[ -f "$file" ]]; then mkdir "${file%.*}"; mv "$file" "${file%.*}"; fi; done
And it works perfectly fine.
But after doing that, I want to zip those folders into individual zip files, and I followed solution here: command to zip multiple directories into individual zip files.
for file in *; do zip -r "${file%.*}.zip" "$file"; rm -R "$file"; done
The question is, how can I combine those 2 into 1-time command? I'm new to coding and I still don't know how to combine those 2 into 1 command.