d
Amit DhamuSoftware Engineer
 

Create A Folder For Each File

1 minute read 00000 views

If we want to create a new folder for each every jpg in a directory, see below:

for x in ./*.jpg; do
  mkdir "${x%.*}" && mv "$x" "${x%.*}"
done