From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Injected-Via-Gmane: http://gmane.org/ To: community@altlinux.ru From: Grigory Batalov Date: Wed, 28 Sep 2005 15:24:06 +0400 Organization: Lanit-Tercom Message-ID: <20050928152406.69e60a57.bga@tepkom.ru> References: <20050928145846.6023de76.bga@tepkom.ru> <433A79A3.5040605@rambler.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bga-ilca.tepkom.ru X-Newsreader: Sylpheed version 0.9.10 (GTK+ 1.2.10; i586-alt-linux-gnu) Sender: news Subject: [Comm] Re: How chmod? X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Linux Community List-Id: ALT Linux Community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 11:27:04 -0000 Archived-At: List-Archive: List-Post: On Wed, 28 Sep 2005 14:08:19 +0300 Olvin wrote: > Grigory Batalov wrote: > >>Есть сложная структура каталогов, каждый файл в них должен иметь права > >>доступа 660 (каталоги соответственно 770). С какими параметрами > >>запускать chmod? > >>Команда > >>#chmod -R 660 koren/ > >>или > >>#chmod -R 660 koren/* > >>Вполне логично убирает запуск с каталогов и получается байда. Как правильно? > > find /path/to/dir -type d -exec chmod 770 {} \; > > find /path/to/dir -type f -exec chmod 660 {} \; > > Будет облом, если файлов в директории >10000 и длина имени каждого файла > более 20 симболов. Мне такое уже попадалось. У меня работает: $ for i in `seq 0 11000`; do mktemp find-test-file.XXXXXXXXXX > /dev/null; done $ ls -1 | wc -l 11001 $ find . -type f -exec chmod 660 {} \; $ ls -la | grep -v rw-rw---- итого 518 drwxr-xr-x 2 bga bga 528096 Сен 28 15:18 . drwx------ 47 bga bga 2464 Сен 28 15:19 .. -- Григорий Баталов, системный администратор ЗАО "Ланит-Терком", тел. +7 (812) 428 48 96, доб. 159