From owner-freebsd-questions@FreeBSD.ORG Sun Apr 1 15:03:24 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 45A5016A401 for ; Sun, 1 Apr 2007 15:03:24 +0000 (UTC) (envelope-from trip@nosubject.org) Received: from smtp1.34sp.com (smtp1.34sp.com [80.82.113.67]) by mx1.freebsd.org (Postfix) with ESMTP id 0C70A13C44C for ; Sun, 1 Apr 2007 15:03:24 +0000 (UTC) (envelope-from trip@nosubject.org) Received: from localhost (localhost.34sp.com [127.0.0.1]) by smtp1.34sp.com (Postfix) with ESMTP id 31CE12E0E3; Sun, 1 Apr 2007 15:40:02 +0100 (BST) Received: from smtp1.34sp.com ([127.0.0.1]) by localhost (smtp.34sp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 89572-02; Sun, 1 Apr 2007 15:40:01 +0100 (BST) Received: from [192.168.1.6] (unknown [62.178.49.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp1.34sp.com (Postfix) with ESMTP id 90F812E0C0; Sun, 1 Apr 2007 15:40:01 +0100 (BST) Message-ID: <460FC3FC.1070002@nosubject.org> Date: Sun, 01 Apr 2007 16:38:52 +0200 From: Bernd Trippel User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: lalev@uni-svishtov.bg References: <1794.212.25.54.147.1175369763.squirrel@mail.uni-svishtov.bg> <6.0.0.22.2.20070331151239.02578380@mail.computinginnovations.com> <460EE543.5080104@u.washington.edu> <460EE81D.3080009@u.washington.edu> In-Reply-To: <460EE81D.3080009@u.washington.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by Clam Anti Virus Cc: freebsd-questions@freebsd.org Subject: Re: deleting file '--preserve-permissions' 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: Sun, 01 Apr 2007 15:03:24 -0000 The fingers of Garrett Cooper typed on 01/04/07 01:00: > Garrett Cooper wrote: >> Derek Ragona wrote: >>> try: >>> rm -i * >>> >>> only answer y to the one you want deleted. >>> >>> -Derek >>> >>> >>> At 02:36 PM 3/31/2007, lalev@uni-svishtov.bg wrote: >>>> I've made mistake with tar. Something like >>>> >>>> tar cvfz --preserve-permissions home.tgz * >>>> >>>> or >>>> >>>> tar cvfz --preserve-permissions * home.tgz >>>> >>>> As result I have a file with name '--preserve-permissions'. >>>> It seems that it's not easy to delete this file. >>>> >>>> rm '--preserve-permissions' >>>> >>>> does not give the desired result. >>>> What should I do :-) >> rm -- '--perserve-permissions'. -- tells getopt to stop searching and >> the single quotes are a double bonus because it doesn't interpret the >> string contents beforehand, but instead passes it on as a straight >> string. >> >> Try: rm "--perserve-permissions" and rm '--perserve-permissions', in >> that order to just see what happens ;).. >> >> -Garrett > Haha. Forgot that the single quotes version won't work by itself. It's > basically for cases when there are shell sensitive characters inside a > string, when compared to the double quotes. The first solution with -- > will work though, guaranteed :). > > -Garrett > _______________________________________________ > 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" > You should always be able to delete files per inode, which is quite handy with files containing special characters. ls -i * 2324367 foo find . -inum 2324367 -exec rm {} \; Saves me a lot of hassle.