A friend wanted to download a bunch mp3s, which are organized by artist and then by album, from me over the WiFi network.
Started running into a lot of permission issues, and I got down to the following command which resolve permission issues.
cd ~/Music/dir/
chmod 0755 *
find . -type d -exec chmod 0755 {} ;
find . -type f -name '*.mp3' -exec chmod 0644 {} ;
find . -type f -name '*.MP3' -exec chmod 0644 {} ;
find . -name '*.DS_Store' -type f -delete
I ran this command from a specific music directory that I have organized by artists. The commands, in order, perform the following:
- Move to the desired directory
- Make all the directories accessible/readable
- Make all subdirectories accessible/readable
- Make all files that end with
mp3readable - Make all files that end with
MP3readable - Delete all
.DS_Storefiles, since sometimes these will have very low permissions that will prevent the entire directories contents from being downloaded (perhaps since they're listed as the first file)
Hope that helps :)