From owner-freebsd-questions@FreeBSD.ORG Sun Nov 28 18:50:40 2004 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 5FCB116A4CE for ; Sun, 28 Nov 2004 18:50:40 +0000 (GMT) Received: from mta10.adelphia.net (mta10.adelphia.net [68.168.78.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id E494343D5F for ; Sun, 28 Nov 2004 18:50:39 +0000 (GMT) (envelope-from parv@chvlva.adelphia.net) Received: from default.chvlva.adelphia.net ([69.160.70.47]) by mta10.adelphia.netESMTP <20041128185039.RHDF18426.mta10.adelphia.net@default.chvlva.adelphia.net> for ; Sun, 28 Nov 2004 13:50:39 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id 2AF2A5D47; Sun, 28 Nov 2004 13:53:34 -0500 (EST) Date: Sun, 28 Nov 2004 13:53:34 -0500 From: Parv To: freebsd-questions@freebsd.org Message-ID: <20041128185333.GA24199@moo.holy.cow> Mail-Followup-To: freebsd-questions@freebsd.org References: <20041128112146.GA1696@oliverfuchs.onlinehome.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041128112146.GA1696@oliverfuchs.onlinehome.de> Subject: Re: what does "rm //" delete? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: f-q@chvlva.adelphia.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Nov 2004 18:50:40 -0000 in message <20041128112146.GA1696@oliverfuchs.onlinehome.de>, wrote Oliver Fuchs thusly... > > I had a directory which contained the following: > > ls showed me simple this: "?" with 0 bytes > ls -axl showed me nothing Try ... ls -lia ... and then, note the inode number in left, your left that is, most column which will be used in ... find . -inum -type d -print0 \ | xargs -0 rm -riv > rm -R // > > This was a big mistake which I noticed soon enough (some files in > /bin were deleted) ... what I want to know is what exactly is > > rm -R // > > deleting. It seems that it is deleting everything? Yes, using '//' is same as '/' in some shells. Try this in a sh-like shell (sh, bash [23], ksh93) ... for shell in sh csh tcsh bash ksh93 blah do shell=$(which $shell) [ -z "$shell" ] && continue echo "checking shell $shell" $shell -c 'cd //usr///local/////bin && echo $PWD && pwd' echo done ... here is what i get in some shells (bash is bash 3) ... checking shell /bin/bash //usr/local/bin //usr/local/bin checking shell /usr/local/bin/ksh93 /usr/local/bin /usr/local/bin - Parv --