From owner-freebsd-questions Fri Aug 20 0: 8:59 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dart.sr.se (dart.SR.SE [193.12.91.98]) by hub.freebsd.org (Postfix) with ESMTP id 96EA31518D for ; Fri, 20 Aug 1999 00:08:36 -0700 (PDT) (envelope-from gunnar@pluto.sr.se) Received: from honken.sr.se ([134.25.128.27]) by dart.sr.se (8.9.3/8.9.3) with ESMTP id JAA14012; Fri, 20 Aug 1999 09:08:22 +0200 (MET DST) Received: from pluto.sr.se (pluto.SR.SE [134.25.193.91]) by honken.sr.se (8.7.5/8.7.3) with ESMTP id JAA21822; Fri, 20 Aug 1999 09:08:21 +0200 (MET DST) Received: (from gunnar@localhost) by pluto.sr.se (8.9.3/8.9.1) id JAA24683; Fri, 20 Aug 1999 09:08:21 +0200 (CEST) (envelope-from gunnar) Date: Fri, 20 Aug 1999 09:08:21 +0200 From: Gunnar Flygt To: "Korchagin, Dmitry" Cc: FreeBSD Questions Subject: Re: Deadless file Message-ID: <19990820090821.B24329@sr.se> Reply-To: Gunnar Flygt References: <000f01beeade$f28515c0$0201a8c0@sting.grata.hippo.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <000f01beeade$f28515c0$0201a8c0@sting.grata.hippo.ru>; from Korchagin, Dmitry on Fri, Aug 20, 1999 at 11:37:37AM +0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Aug 20, 1999 at 11:37:37AM +0400, Korchagin, Dmitry wrote: > Hello & Help! > > I have created file with name "-z" in mistake and can't remove it. > > $ ls > -z > $ rm -z > rm: illegal option -- z > > How can I remove such files? Start using the man pages! It's a real good source for knowledge! From the man page for rm: The rm command uses getopt(3) to parse its arguments, which allows it to accept the `--' option which will cause it to stop processing flag op- tions at that point. This will allow the removal of file names that be- gin with a dash (`-'). For example: rm -- -filename So in your case `rm -- -z` would do the trick -- __o regards, Gunnar ---_ \<,_ email: flygt@sr.se ---- (_)/ (_) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message