[comp.unix.questions] How do I remove a stubborn file?

brenner@ucunx1.san.uc.edu (David L. Brenner) (04/24/91)

I need to know how to remove a file from my account.  Some background,
I had dialed in from home, and while saving a file, some linenoise came
across and got embedded in the file name.  Well, this means I can't
access this file.  I have tried all of the following:

    %rm -i *
    %rm * 
    %rm -rf *

all of them returned: 'file does not exist'.  

The question is: how do I get rid of this file?  Any and all help will
be greatly appriciated.

Thanks in advance,
David Brenner

-- 
David L. Brenner                         brenner@ucunix.san.uc.edu
"Sorry, guys -- breaking into computers and writing a stupid virus
 doesn't make you a hacker.  It's not that easy."
  -- Robert Stevenson, Computerworld

c60b-1eq@e260-1e.berkeley.edu (Noam Mendelson) (04/25/91)

In article <1991Apr24.141633.26512@ucunx1.san.uc.edu> brenner@ucunx1.san.uc.edu (David L. Brenner) writes:
>I need to know how to remove a file from my account.  Some background,
>I had dialed in from home, and while saving a file, some linenoise came
>across and got embedded in the file name.  Well, this means I can't
>access this file.  I have tried all of the following:
>
>    %rm -i *
>    %rm * 
>    %rm -rf *
>
>all of them returned: 'file does not exist'.  

Since you tried rm -rf I'll assume that the file is in a subdirectory.
Move up one level and try
	rm -fr foo
where foo is the name of the subdirectory.

-- 
+==========================================================================+
| Noam Mendelson   ..!ucbvax!web!c60b-1eq       | "I haven't lost my mind, |
| c60b-1eq@web.Berkeley.EDU                     |  it's backed up on tape  |
| University of California at Berkeley          |  somewhere."             |

pha21@seq1.keele.ac.uk (Braham Levy) (04/25/91)

In article <1991Apr24.141633.26512@ucunx1.san.uc.edu>, brenner@ucunx1.san.uc.edu (David L. Brenner) writes:
> I need to know how to remove a file from my account.  Some background,
> I had dialed in from home, and while saving a file, some linenoise came

anyone tried this recently ??

	ls -li   ..... get inode number for file in question
	find . -inum <inode number> -exec -rm {} \;

this has worked for me for years... don't forget the "\;" they're needed.
this saves having to junk a complete directory. 

braham


j braham levy					| UDSP Lab, EE 
JANET:	brahamlevy@uk.ac.keele			| Physics Department,
USENET:	brahamlevy@keele.ac.uk			| University of Keele , Keele,
UUCP: ...ukc!keele.ac.uk!brahamlevy		| Staffordshire, ST5 5BG, UK.
						| +44-782-621111 ext 3943

weimer@garden.ssd.kodak.com (Gary Weimer (253-7796)) (04/26/91)

In article <1111@keele.keele.ac.uk>, pha21@seq1.keele.ac.uk (Braham
Levy) writes:
|> 	ls -li   ..... get inode number for file in question
|> 	find . -inum <inode number> -exec -rm {} \;
                                          ^
and when the find fails, just type (in csh):

example% ^-rm^rm^

(Sorry, but it didn't work for removing -csh in my bin directory. :-) )

weimer@ssd.kodak.com ( Gary Weimer )