[net.unix] more on strange file names

damon@lmef.UUCP (Damon Scaggs) (08/02/85)

A while back there was considerable discussion about how to delete files
with names with the high bit set. Apparently the shell does strange things
with this bit and it is lost somewhere between the keyboard and the unlink.
If you know the inode of the file I think the following is the easiest way
to remove it.  Move to the directory it is in first:

	find . -inum (inode # of file) -exec /bin/rm {} \;

Certainly this is better than clri followed by a fsck.  find won't play
games with the top bit.  Just hope the file isn't in / !


-- 
Damon Scaggs
{ihnp4,akgua}!sol1!lmef!damon

levy@ttrdc.UUCP (Daniel R. Levy) (08/04/85)

> find . -inum # -exec /bin/rm {} \;

Guys, this actually works even on file names containing non-ascii characters!
Try it (write a little c program which creates such a file, then proceed to
bomb it this way).  In fact if you want to keep the file, /bin/mv will work
just fine too (to give it a name accessible from the shell).  If the file is
in / or some other directory under which several filesystems are mounted, no
sweat.  Change the /bin/rm to /bin/rm -i.
-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer, my pets, my plants, my boss, or the
| at&t computer systems division |  s.a. of any computer upon which I may hack.
|        skokie, illinois        |
|          "go for it"           |  Path: ..!ihnp4!ttrdc!levy
 --------------------------------     or: ..!ihnp4!iheds!ttbcad!levy

jwp@uwmacc.UUCP (Jeffrey W Percival) (08/04/85)

In article <137@lmef.UUCP> damon@lmef.UUCP (Damon Scaggs) writes:
>A while back there was considerable discussion about how to delete files
>
>	find . -inum (inode # of file) -exec /bin/rm {} \;
>
>Certainly this is better than clri followed by a fsck...

Nope.  The original posting concerned 2.8BSD, and *nothing* using "rm"
worked.  Nothing whose performance ultimately relied on "unlink(2)" did
the job.  I received many suggestions, and tried them all, but my file
names were such that only the clri method was successful.

-- 
	Jeff Percival ...!uwvax!uwmacc!jwp