From owner-freebsd-questions@FreeBSD.ORG Sun Mar 13 10:09:14 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9084316A4CE for ; Sun, 13 Mar 2005 10:09:14 +0000 (GMT) Received: from hosea.tallye.com (joel.tallye.com [216.99.199.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEDD343D49 for ; Sun, 13 Mar 2005 10:09:13 +0000 (GMT) (envelope-from lorenl@alzatex.com) Received: from hosea.tallye.com (hosea.tallye.com [127.0.0.1]) by hosea.tallye.com (8.12.8/8.12.10) with ESMTP id j2DA9CUQ019424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Mar 2005 02:09:13 -0800 Received: (from sttng359@localhost) by hosea.tallye.com (8.12.8/8.12.10/Submit) id j2DA9CTU019422; Sun, 13 Mar 2005 02:09:12 -0800 X-Authentication-Warning: hosea.tallye.com: sttng359 set sender to lorenl@alzatex.com using -f Date: Sun, 13 Mar 2005 02:09:12 -0800 From: "Loren M. Lang" To: Fafa Diliha Romanova Message-ID: <20050313100912.GD18080@alzatex.com> References: <20050312115359.C14EF4BE6D@ws1-1.us4.outblaze.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GpGaEY17fSl8rd50" Content-Disposition: inline In-Reply-To: <20050312115359.C14EF4BE6D@ws1-1.us4.outblaze.com> User-Agent: Mutt/1.4.1i X-GPG-Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc X-GPG-Fingerprint: B3B9 D669 69C9 09EC 1BCD 835A FAF3 7A46 E4A3 280C cc: questions@freebsd.org Subject: Re: chmod equivalent to find commands X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2005 10:09:14 -0000 --GpGaEY17fSl8rd50 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 12, 2005 at 06:53:59AM -0500, Fafa Diliha Romanova wrote: > hello. >=20 > i know there's an equivalent to these two find commands that > can be summed up in one chmod command: >=20 > find . -type d -exec chmod 755 {} \; > find . -type f -exec chmod 644 {} \; The EXACT equivalent would be: find . -type d -exec chmod u=3Drwx,go=3Drx {} \; find . -type f -exec chmod u=3Drw,go=3Dr {} \; But I take it that that isn't exactly what your looking for. Your probably looking for something like "chmod -R u=3DrwX,go=3DrX ." >=20 > it fixes my permissions ... > i haven't tested this yet but i think it's wrong: chmod -R u+rwX,a+rX This may work it depends on exactly what you need to do and how bad your permissions are messed up. Instead of a+rX, it might be better to do go+rX since you already have u covered, but I don't think it will make a big difference. Also, this adds to the existing permissions, it won't take away any permissions like my example earlier does. Lastly, the big difference between this and the find version is that the find version, both mine and yours, will set the execute bit on all directories and not on any normal files where the recursive chmod with the X permission with set the x permission on any file/directory that already has at least one type of execute permission already set and not on any other files or directories. So if your permissions are messed so badly that you have directories without any execute permission, this won't fix that. The find version on the other hand will ignore everything that is not a normal file or directory (i.e. fifos, sockets, device files), but this probably won't be a big deal either. The single recursive chmod I gave you will most likely be what you need. >=20 > what would be the best solution here? >=20 > thanks, > -- fafa >=20 > --=20 > ___________________________________________________________ > Sign-up for Ads Free at Mail.com > http://promo.mail.com/adsfreejump.htm >=20 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" --=20 I sense much NT in you. NT leads to Bluescreen. Bluescreen leads to downtime. Downtime leads to suffering. NT is the path to the darkside. Powerful Unix is. Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc Fingerprint: CEE1 AAE2 F66C 59B5 34CA C415 6D35 E847 0118 A3D2 =20 --GpGaEY17fSl8rd50 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD4DBQFCNBFIbTXoRwEYo9IRAhgHAJjmpYnalMAfh1psKqCcl2jlCXN5AJ4ilEWx VtrIGvc7LEwKwStnjpQSNw== =C1nr -----END PGP SIGNATURE----- --GpGaEY17fSl8rd50--