From owner-freebsd-questions@FreeBSD.ORG Wed May 7 14:39:27 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CE26106567E for ; Wed, 7 May 2008 14:39:27 +0000 (UTC) (envelope-from wangyi6854@gmail.com) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.185]) by mx1.freebsd.org (Postfix) with ESMTP id AC1D28FC26 for ; Wed, 7 May 2008 14:39:26 +0000 (UTC) (envelope-from wangyi6854@gmail.com) Received: by ti-out-0910.google.com with SMTP id d27so92269tid.3 for ; Wed, 07 May 2008 07:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=K3pAzxciwinrEOKre52WdFuUhRQDJeJFJgFwAf4ClYE=; b=lFvmtNA/nq7a4+n8k5fo68SrgTusTU0oOVCg2PH0WSAGm203kZoHyfBPXk4+Jq7qaY6JGt0NfR7WI9qLqHaEfXz8ramdF/B3JKR1+PDZ4CVhnKuCVmdsLSOMXMC1E8C1TzeUqlinWxqvGQdnajSFmCdu3BxgBLeYfwSJXR8x9Kg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iLaNmhUPlLUoAWvBq3FJSp1PylylmqY97AnXRcAA0IG84ncUbcXjlPLL8A0pGahXYOnW76G0/wbPQLhreOKyOBFMgsnSN6kXHtw99vuvnwQXFClBEOIVv2n3LuNbkJDkdhmHpuT5FXoUSJjknyNfqcL3Em9yNXa7EF4VPG0bxAg= Received: by 10.110.20.17 with SMTP id 17mr201873tit.12.1210169504826; Wed, 07 May 2008 07:11:44 -0700 (PDT) Received: by 10.110.93.6 with HTTP; Wed, 7 May 2008 07:11:44 -0700 (PDT) Message-ID: <5ea5cca50805070711k76163c85ybd047f8b18a2e836@mail.gmail.com> Date: Wed, 7 May 2008 22:11:44 +0800 From: "Yi Wang" To: "Catalin Miclaus" In-Reply-To: <3A0AA7018522134597ED63B3B794C92A01DAE740@STA-HQ-S001.starcomms.local> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <482198FA.8070708@lc-words.com> <3A0AA7018522134597ED63B3B794C92A01DAE740@STA-HQ-S001.starcomms.local> Cc: z.szalbot@lc-words.com, freebsd-questions@freebsd.org Subject: Re: chmod operation on directories / files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2008 14:39:27 -0000 sorry, I forgot to reply to all. for directorys, you can use: chmod 755 */ if the files have a suffix. you can use chmod 644 *.* for the files don't have the suffix, I guess a regex should solve it. But I'm not familiar with regex. :-) On 5/7/08, Catalin Miclaus wrote: > -----Original Message----- > From: owner-freebsd-questions@freebsd.org > [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Zbigniew > Szalbot > Sent: Wednesday, May 07, 2008 12:57 PM > To: freebsd-questions@freebsd.org > Subject: chmod operation on directories / files > > Hello, > > 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 > www.lc-words.com > > > > > > 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. > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- Regards, Wang Yi