From owner-freebsd-hackers@FreeBSD.ORG Thu May 5 16:00:34 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B4A6F16A4CE for ; Thu, 5 May 2005 16:00:34 +0000 (GMT) Received: from web52704.mail.yahoo.com (web52704.mail.yahoo.com [206.190.39.155]) by mx1.FreeBSD.org (Postfix) with SMTP id 4CCB043D5F for ; Thu, 5 May 2005 16:00:34 +0000 (GMT) (envelope-from thorpflyer@yahoo.com) Received: (qmail 6891 invoked by uid 60001); 5 May 2005 16:00:29 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=nQBx9n55waTps4avXzqx2TWMDFJlr+43DvGQAuZU0BLDxhgaABsDFheYbfVnDIjf0ttY1MjnKOjzCVkssmBGyjuy8U2BvN5YeggK0oa2iFhzkZGCcboNS1hiOHJn95Or5mibO/2EQRoMR4EtbARGZHXA+cfEVO38YmgGOstyD+E= ; Message-ID: <20050505160029.6889.qmail@web52704.mail.yahoo.com> Received: from [67.166.15.143] by web52704.mail.yahoo.com via HTTP; Thu, 05 May 2005 09:00:29 PDT Date: Thu, 5 May 2005 09:00:29 -0700 (PDT) From: Simon Roberts To: freebsd-hackers@freebsd.org In-Reply-To: 6667 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: req: New feature to rm? Remove file by the inode number X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: simon.roberts@earthlink.net List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 16:00:34 -0000 A couple of observations: 1) Implicit in most people's answers is the fact that a single inode can have many directory entries. That's why find is used. That's also why the solution below won't work, as it doesn't check the entire file system (nor would you want to answer y/n for all those files :) 2) The same inode number can exist for multiple files in a system. This occurs if multiple file systems exist. So, if you use find to achieve the desired effect, be very sure that you run it from the root of the target file system and that you tell it not to traverse onto other file systems. If you run it from the root directory, you're very likely to delete one or more files you didn't mean to delete. Point 2, likely as not, might explain why there's no simple mechanism for doing this from rm. At the very least you'd have to specify the file system you're referring to, and many "plain" users couldn't do that safely. Those that can are probably able to use find anyway. Cheers, Simon --- Raymond Wiker wrote: > Erik Udo writes: > > I couldn't find a way to remove files that had > scandic/non-printable > > letters, then i remembered ls showed inode number > of the file. Is it > > possible to remove the file by the inode number? > It would be a > > useful feature :) > > > > I bet there is a way to remove those files, but > only > > third party programs came to my mind. > > How about rm -i ./*? > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > __________________________________ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail