chmod operation on directories / files

Catalin Miclaus catalin at
Wed May 7 13:11:58 UTC 2008

-----Original Message-----
From: owner-freebsd-questions at
[mailto:owner-freebsd-questions at] On Behalf Of Zbigniew
Sent: Wednesday, May 07, 2008 12:57 PM
To: freebsd-questions at
Subject: chmod operation on directories / files


How do I chmod separately files and directories?

If I use chmod -R 644 then it will go through all the subdirectories 
assigning everything 644 permissions, directories including.

Many thanks!

Zbigniew Szalbot

find /test -type f -exec chmod 644 {} \;

Replace /test with full path to your directory.
For directories use '-type d'.

Best Regards
Catalin Miclaus
Network/Security ISP-Data
Starcomms Ltd.

More information about the freebsd-questions mailing list