From owner-freebsd-questions Fri Jun 30 14:13:54 2000 Delivered-To: freebsd-questions@freebsd.org Received: from wopr.caltech.edu (wopr.caltech.edu [131.215.102.114]) by hub.freebsd.org (Postfix) with ESMTP id F29E837B5CD for ; Fri, 30 Jun 2000 14:13:50 -0700 (PDT) (envelope-from mph@wopr.caltech.edu) Received: (from mph@localhost) by wopr.caltech.edu (8.9.3/8.9.3) id OAA12083; Fri, 30 Jun 2000 14:13:42 -0700 (PDT) (envelope-from mph) Date: Fri, 30 Jun 2000 14:13:41 -0700 From: Matthew Hunt To: Pedro Hernandez Cc: FreeBSD Questions List Subject: Re: Erasing files ... Message-ID: <20000630141341.A11964@wopr.caltech.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from pedro@hci.com.mx on Fri, Jun 30, 2000 at 04:07:30PM -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Jun 30, 2000 at 04:07:30PM -0600, Pedro Hernandez wrote: > How can I delete a file named "-z" from root file system ? You can use the '--' flag to rm, which tells it that there are no more flags, and everything else is a filename: wopr:~/tmp$ ls -l total 2 -rw-rw-r-- 1 mph mph 0 Jun 30 14:10 -z drwxr-xr-x 3 mph mph 1024 Jun 28 19:11 pictures/ wopr:~/tmp$ rm -- -z wopr:~/tmp$ ls -l total 2 drwxr-xr-x 3 mph mph 1024 Jun 28 19:11 pictures/ Or, explicitly specify a path so that the first character isn't a hyphen: wopr:~/tmp$ ls -l total 2 -rw-rw-r-- 1 mph mph - 0 Jun 30 14:10 -z drwxr-xr-x 3 mph mph - 1024 Jun 28 19:11 pictures/ wopr:~/tmp$ rm ./-z wopr:~/tmp$ ls -l total 2 drwxr-xr-x 3 mph mph 1024 Jun 28 19:11 pictures/ -- Matthew Hunt * UNIX is a lever for the http://www.pobox.com/~mph/ * intellect. -J.R. Mashey To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message