Command to batch move filetypes to directories with the same name (linux) #224
ChiefMedicalOfficer
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I had to use this command for the first time the other day as I had 20 single mp3 files that were all individual audiobooks under a parent directory of 'author'.
I used the following command to move all those files based on file type to directories with the same name as the file. Maybe it could come in handy.
cd /location/of/files
for file in *.mp3; do mkdir -- "${file%.mp3}"; mv -- "$file" "${file%.mp3}"; done
Beta Was this translation helpful? Give feedback.
All reactions