Recursive chmod

My music collection is complicated, I rip my CD’s on a Linux server, FTP them to a Windows server. Manipulate ID tags and filenames using various means, then FTP them back again in order to play them through my Squeezebox. This recently caused me grief when I used an incorrect umask on a massive transfer, resulting in incorrect file permissions on directories and files.

Using recursive chmod to correct this is tricky as file and subdirectory permissions need to be different, in my case, 644 for files and 755 for directories. These two commands solve the problem:

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

2 comments

  1. Hi Jens,

    Thanks for that info. I’ve never bothered swapping shell until your comment prompted me to try out zsh.

    First things first, get the prompt looking nice. :-)
    Next, figure out the globing. Impressive!
    The completion options look good too although I haven’t dug into them yet.

    Makes me wonder why more distros don’t make this the default login shell. I think I’ll be sticking with it.

Leave a comment