From owner-freebsd-questions@FreeBSD.ORG Thu Sep 4 05:28:32 2008 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 A9A58106566C for ; Thu, 4 Sep 2008 05:28:32 +0000 (UTC) (envelope-from dave.list@pixelhammer.com) Received: from smtp2.tls.net (smtp2.tls.net [65.124.104.105]) by mx1.freebsd.org (Postfix) with ESMTP id 511218FC15 for ; Thu, 4 Sep 2008 05:28:32 +0000 (UTC) (envelope-from dave.list@pixelhammer.com) Received: (qmail 49044 invoked from network); 4 Sep 2008 05:28:31 -0000 Received: by simscan 1.2.3 ppid: 49035, pid: 49041, t: 0.1419s scanners: attach: 1.2.3 spam: 3.2.1 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on smtp-2.tls.net X-Spam-Level: X-Spam-Status: No, score=0.2 required=10.0 tests=ALL_TRUSTED,TVD_RCVD_IP autolearn=disabled version=3.2.1 Received: from 208-70-44-246.bb.hrtc.net (HELO ?192.168.1.46?) (ldg%tls.net@208.70.44.246) by auth-smtp2.tls.net with ESMTPA; 4 Sep 2008 05:28:31 -0000 Message-ID: <48BF71F9.9000004@pixelhammer.com> Date: Thu, 04 Sep 2008 01:28:25 -0400 From: DAve User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.org References: <20080904034833.GA25655@k7.mavetju> In-Reply-To: <20080904034833.GA25655@k7.mavetju> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: cd and rm a directory with '^M' 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: Thu, 04 Sep 2008 05:28:32 -0000 Edwin Groothuis wrote: >> I had rsync create a directory with a '^M' in it. > > Use command-line completion: > > [~/xx] edwin@k7>touch foo^Mbar # that's ^V^M > [~/xx] edwin@k7>ls -l > total 0 > -rw-r--r-- 1 edwin edwin 0 Sep 4 13:46 foo?bar > [~/xx] edwin@k7>rm foo # autocompletes to foo^Mbar > > If you find yourself on a machine without a full featured shell you can delete by the inode number. Chuck Swiger saved my bacon with that trick several years ago. [sysadmin /usr/home/sysadmin]$ touch abc^M [sysadmin /usr/home/sysadmin]$ ls -i 2449500 abc? 2449511 env.sh [sysadmin /usr/home/sysadmin]$ find . -type f -inum 2449500 | xargs rm [sysadmin /usr/home/sysadmin]$ ls -i 2449511 env.sh I've needed but a few times since then, but when I did... DAve -- Don't tell me I'm driving the cart!