From owner-freebsd-questions@FreeBSD.ORG Wed Apr 11 18:10:09 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0316116A401 for ; Wed, 11 Apr 2007 18:10:09 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.185]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB2D13C469 for ; Wed, 11 Apr 2007 18:10:08 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: by mu-out-0910.google.com with SMTP id g7so317465muf for ; Wed, 11 Apr 2007 11:10:07 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=ZxuI+SGXvIMQplOFY5JeP9uh0v8dkQe4FoTie96A+G6hHAB7mra7HgpJD0g1lOSE8c7Jlbx/rA9v2F+OXgXoB2JbXMF38LIxXW5adDxuk9TRkIbHBTNL16NyReMpIIEE+cOYDv3fU1kKg0/RSZhLaavKTEjSj2PLgiiXEB2vOmE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=V0Z+zfHIwYIL1fKMMivBL20eV4CFNj3V5cBrTXlJVAPMsrLa0vlGTL6vOCW3y4INOIZbOtC77PqzGJ4gqHttdN7BFcVnp+0I+RQOlJWN5GZt8tJYTPxxUj1TGLmIe+vPa6QYGw3r+LcXz1i5cWraVN4u7sEWNUwdXVZutKSmc3E= Received: by 10.82.163.13 with SMTP id l13mr1305412bue.1176315006808; Wed, 11 Apr 2007 11:10:06 -0700 (PDT) Received: from ?192.168.123.111? ( [84.2.98.83]) by mx.google.com with ESMTP id w5sm193850mue.2007.04.11.11.10.05; Wed, 11 Apr 2007 11:10:06 -0700 (PDT) Message-ID: <461D24EF.2050507@gmail.com> Date: Wed, 11 Apr 2007 20:11:59 +0200 From: deeptech71@gmail.com User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Pieter de Goeje References: <461D0614.2060709@gmail.com> <200704111849.08117.pieter@degoeje.nl> In-Reply-To: <200704111849.08117.pieter@degoeje.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: rm --clear-directory /home/me/another_dir 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, 11 Apr 2007 18:10:09 -0000 Pieter de Goeje wrote: > On Wednesday 11 April 2007, deeptech71@gmail.com wrote: >> Is there a way to clear a directory with such a command (keeping the owner >> and permissions of the folder)? >> >> Yes there are the obvious ones: >> cd /home/me/another_dir && rm * >> rm /home/me/another_dir/* // if cant traverse here >> >> But something that doesn't rely on the shell. > cd /some/dir && find . -delete > > Cheers, Pieter > Well, IMO, for aesthetical and logical purposes, /some/dir should point to the directory, and /some/dir/ should point to the inside of the directory (as in copy INTO or FROM). So: # cp /one /two/ // this copies dir one into dir two, so there will be a dir named /one/two after this command # cp /one/ /two/ ==> Do you want to recursively overwrite contents of dir /two with the content of dir /one ? [n] y # cp /one /two ==> Do you want to recursively overwrite /two with /one ? [n] y # cp /one/ /two cp: error - overwrite a dir with some other contents? WTF? oh and of course: rm -R /dir // removes dir rm -R /dir/ // clears dir How hard will it be to convince the developers to swich to this scheme? since all scripts will have to be reworked...