Copying music

An anoyance that happens frequently when copying stuff from NTFS partitions to (whatever) Linux partition is the messed up file permissions. This can be fixed rather easily for, e.g., a music folder:

find music/ -type f | sed “s/^.*/\”&\”/” | xargs chmod 644

The above statement finds all files in the music folder, puts the resulting file names into parantheses (as they may contain spaces) and sets permissions suitable for music files. And in case of messy directory rights:

find music/ -type d | sed “s/^.*/\”&\”/” | xargs chmod 755

One thought on “Copying music

  1. Much simpler:
    find . -type d -exec chmod -c 0755 {} \;
    find . -type f -exec chmod -c 755 {} \;

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.