From owner-freebsd-questions@FreeBSD.ORG Sat Feb 11 08:41:07 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0860B106566B for ; Sat, 11 Feb 2012 08:41:07 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (unknown [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id D834C8FC14 for ; Sat, 11 Feb 2012 08:41:06 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id q1B8f6p1056268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 11 Feb 2012 00:41:06 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id q1B8f6pn056267 for freebsd-questions@freebsd.org; Sat, 11 Feb 2012 00:41:06 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 ([192.168.200.81]) by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA08904; Sat, 11 Feb 12 00:34:28 PST Date: Sat, 11 Feb 2012 07:33:27 -0800 From: perryh@pluto.rain.com To: freebsd-questions@freebsd.org Message-Id: <4f368a47.b9IiheSL9TAxtlPw%perryh@pluto.rain.com> References: <1237723287.20120207235924@yandex.ru> <4F31A260.20109@infracaninophile.co.uk> <20120207231716.31aa8bc3@gumby.homeunix.com> <20120209032544.GA58560@ozzmosis.com> <4F3541D6.5080505@infracaninophile.co.uk> In-Reply-To: <4F3541D6.5080505@infracaninophile.co.uk> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: 'rm' Can not delete files 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: Sat, 11 Feb 2012 08:41:07 -0000 Matthew Seaman wrote: > >>> ls -1 | xargs rm > > >> but be aware that that wont work for filenames with spaces. > > True. Can't do that using ls to generate the list of filenames as > there is no option to generate a null-separated list amongst ls's > multitudinous collection. It can, however, be done indirectly :) $ ls -1 | tr '\012' '\000' | xargs -0 rm