Files as files

From: Doug Yowza <yowza_at_yowza.com>
Date: Thu Jun 11 13:43:28 1998

On Thu, 11 Jun 1998, Pete Turnbull wrote:

> On Jun 11, 3:36, Doug Yowza wrote:
>
> > That used to be one of my interview questions for Unix programmers: your
> > buggy program just created a filename with {control characters, leading
> > dash (-), leading slash (/), '*', etc} in it. How do you delete it?
>
> Quickest general method is "rm -i *", though you may sometimes need
> "rm -i .*" instead/as well.

If you had a file named "-f" in your directory, then "rm -i *" would
happily delete all of the files in the directory without prompting you.

"rm -i ./*" would be better, but would not work for files with control
characters or spaces.

If you wanted to stick with the "-i" approach, then "cd .. ; rm -r -i dir"
would be the best bet (assuming your rm had a -r option to recurse).

-- Doug
Received on Thu Jun 11 1998 - 13:43:28 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:31:04 BST