Skip to main content
added 109 characters in body
Source Link
user3439894
  • 60.8k
  • 10
  • 115
  • 138

In Terminal, change directory to the folder containing the files, e.g.:

cd /path/to/files 

Then use the following compound command to do what you've asked:

for f in *.*; do [ -f "$f" ] || continue; mkdir "${f%.*}" && mv "$f" "${f%.*}"; done 

If you want to limit it to just .m4v files, then change for f in *.*; to:
for f in *.m4v;

Note that this doesn't make a folder with the ƒ character you've shown, but if it's part of the wanted folder name, then change both occurrences of $"${f%.*}" to: $"${f%.*} ƒ"

In Terminal, change directory to the folder containing the files, e.g.:

cd /path/to/files 

Then use the following compound command to do what you've asked:

for f in *.*; do [ -f "$f" ] || continue; mkdir "${f%.*}" && mv "$f" "${f%.*}"; done 

Note that this doesn't make a folder with the ƒ character you've shown, but if it's part of the wanted folder name, then change both occurrences of ${f%.*}" to: ${f%.*} ƒ"

In Terminal, change directory to the folder containing the files, e.g.:

cd /path/to/files 

Then use the following compound command to do what you've asked:

for f in *.*; do [ -f "$f" ] || continue; mkdir "${f%.*}" && mv "$f" "${f%.*}"; done 

If you want to limit it to just .m4v files, then change for f in *.*; to:
for f in *.m4v;

Note that this doesn't make a folder with the ƒ character you've shown, but if it's part of the wanted folder name, then change both occurrences of "${f%.*}" to: "${f%.*} ƒ"

Source Link
user3439894
  • 60.8k
  • 10
  • 115
  • 138

In Terminal, change directory to the folder containing the files, e.g.:

cd /path/to/files 

Then use the following compound command to do what you've asked:

for f in *.*; do [ -f "$f" ] || continue; mkdir "${f%.*}" && mv "$f" "${f%.*}"; done 

Note that this doesn't make a folder with the ƒ character you've shown, but if it's part of the wanted folder name, then change both occurrences of ${f%.*}" to: ${f%.*} ƒ"