Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 May 2008 14:09:45 +0200
From:      Baptiste Grenier <baptiste.grenier@healthgrid.org>
To:        Zbigniew Szalbot <z.szalbot@lc-words.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: chmod operation on directories / files
Message-ID:  <20080507120944.GA4405@healthgrid.org>
In-Reply-To: <482198FA.8070708@lc-words.com>
References:  <482198FA.8070708@lc-words.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Le 07/05/08 à 14:00, Zbigniew Szalbot téléscripta :
> Hello,

Hi,

> 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.
>

Using find(1), you can try something like this:

For files:
  find /plop -type f -exec chmod 644 '{}' \;

For dirs:
  find /plop -type d -exec chmod 755 '{}' \;

> Many thanks!

HTH,
Baptiste

-- 
Baptiste Grenier | PGP: 0x069112E2
HealthGrid SysAdmin
http://healthgrid.org/

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkghnAMACgkQLLKEaQaREuKgngCgt9davDnWxoelHSNQUy3iQHw3
CJ0An2hv1ltugeAqO4fP/vycTZhN14aU
=AA4s
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080507120944.GA4405>