No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help
View Responses


Grex Info Item 82: Indestructable File
Entered by chelsea on Tue Nov 30 21:16:53 UTC 1993:

Ok, you're not allowed to ask why I did it but I created two
files, one named <twit and the other >twit.  When I try to
delete them or rename them I'm greeted with, "No such file or
directory".  Bummer.  How do I get rid of them?

35 responses total.



#1 of 35 by scg on Tue Nov 30 21:58:55 1993:

Would it be possible to move the other files in the directory somewhere
else and then delete the whole directory?  I haven't tried this, but it
might work.  An other thing that occurred to me is to put the filenames in
quotes.  If that works it would be much simpler.


#2 of 35 by rcurl on Wed Dec 1 00:07:06 1993:

(She's dividing us into those lower than a twit, and higher than a twit.)


#3 of 35 by davel on Wed Dec 1 01:52:13 1993:

This probably won't work, since you'll have tried it already, but I'd expect
one of the following two methods to do it:
rm ?twit
rm -i *     (and then don't confirm anything but the ones you want).

There's probably something simple I'm overlooking.


#4 of 35 by davel on Wed Dec 1 02:01:13 1993:

Well, I tested creating & removing files with those names, & had no trouble.
Both    rm ?twit      and Steve's suggestion of    rm '>twit' '<twit'
seemed to work fine.  (Note: I use sh; if you're using csh or something else
& these methods don't work, try running sh & issuing such commands there.)

Obviously,     rm <twit    won't work, since that's trying to run rm with
input from the nonexistent file twit.  I suspect that's what you tried, but
I don't know.


#5 of 35 by chelsea on Wed Dec 1 14:35:28 1993:

They are gone.  I used the "rm ?twit" command and it worked
just fine.  Thanks for the help.

I guess I should count my blessings I didn't name that file
what originally sprang to mind.  This is a family system and all. ;-)


#6 of 35 by davel on Wed Dec 1 16:11:12 1993:

It is often quite easy to create files with special characters in them via
programs that open files (since it's the shells that interpret characters
such as * and ? and > and <).  And even with the shell it's all too easy to
create files containing such characters in their names:

   $ >test?
   $ ls -l test?
   -rw-r--r--  1 davel           0 Dec  1 11:05 test?
   $ >test*
   $ ls -l test?
   -rw-r--r--  1 davel           0 Dec  1 11:06 test*
   -rw-r--r--  1 davel           0 Dec  1 11:05 test?
   $ rm -i test?
   rm: remove test*? y
   rm: remove test?? y
   $ 

Note that in the first line the ? is interpreted as just another filename
character; everywhere else that I typed it, it's interpreted by sh as a
template character and matched.


#7 of 35 by popcorn on Wed Dec 8 02:02:27 1993:

This response has been erased.



#8 of 35 by vidar on Tue Dec 21 02:29:35 1993:

Speaking of indestructible files, I acidentially saved a game as !saved on
/u/vidar and have not been able to get rid of it.


#9 of 35 by popcorn on Tue Dec 21 02:38:49 1993:

This response has been erased.



#10 of 35 by kaplan on Thu Dec 23 14:46:45 1993:

I'm no UNIX wizard, but wouldn't the backslash character be useful in these
situations?


#11 of 35 by remmers on Thu Dec 23 19:13:26 1993:

It often is -- to the shell, the backslash quotes the immediately
following character.  So

        rm \>twit

would probably work.

Consider this question though:  Suppose that somehow you managed to
create a file named "-i".  How would you delete it?


#12 of 35 by mju on Thu Dec 23 21:53:08 1993:

(If you know the answer, should you say?)


#13 of 35 by kentn on Thu Dec 23 23:59:48 1993:

rm ./-i works just fine


#14 of 35 by popcorn on Fri Dec 24 15:15:05 1993:

This response has been erased.



#15 of 35 by vidar on Fri Dec 31 01:20:48 1993:

<evil grin>


#16 of 35 by carson on Wed Jan 19 06:48:56 1994:

How? How?


#17 of 35 by vidar on Fri Jan 28 03:04:23 1994:

By manipulating my mouth, stupid.


#18 of 35 by carson on Fri Jan 28 14:05:23 1994:

!twit vidar

how? how?


#19 of 35 by vidar on Wed Feb 16 01:40:40 1994:

I thought this item was about Indestructabile files.
I cannot manage to destroy my registration in the Language conference.

every time I "rm .langl.cf" grex tells me that there is no such file
or directory!  Help!  I beseech thee...


#20 of 35 by gerund on Wed Feb 16 03:12:20 1994:

hmm, but shouldn't it be a "rm .lang1.cf" and not "rm langl.cf"?
the difference being that its a 1 and not an l?


#21 of 35 by popcorn on Wed Feb 16 05:31:23 1994:

This response has been erased.



#22 of 35 by carson on Wed Feb 16 17:20:18 1994:

*RE: 11:*]

how? how?


#23 of 35 by davel on Thu Feb 17 01:09:27 1994:

rm -i ./-i     or    rm -i -- -i    should do it.

The form with -- works with programs conforming to current standards, which
excludes a *lot* of stuff, but worked with rm on grex last time I tried it.
The other one should work more widely.  (Note that Kent *did* give it in
#13, Carson.)


#24 of 35 by carson on Thu Feb 17 22:33:12 1994:

Mea culpa. I was confused by response 14 and the lack of responses afterwards.

I'll have to go try it out now!


#25 of 35 by nestene on Thu Feb 17 23:15:56 1994:

By the way, is there an actual rm-file I can invoke to get around
having aliased it to 'rm -i'?


#26 of 35 by gregc on Thu Feb 17 23:21:43 1994:

Well, you can either type "/bin/rm" that forces the shell to use the
actual binarie and bypasses the alias, or you can remove the alias with
"unalias rm".


#27 of 35 by robh on Sat Feb 19 17:13:24 1994:

Also, if you put a backslash before any command, it turns off
the aliasing, i.e. "\rm filename"


#28 of 35 by vidar on Sun Feb 20 13:49:32 1994:

Using the 1 helped me destory registration.


#29 of 35 by mcpoz on Tue Dec 26 01:28:05 1995:

How do I change the name of a file already existing in my directory?
(thanks)


#30 of 35 by robh on Tue Dec 26 02:27:28 1995:

        mv filename newfilename

mv for "move", you can also use it to move a file to a new
directory.


#31 of 35 by davel on Fri Dec 29 21:30:09 1995:

You may want to be aware of the   -i   option on mv.  This prevents your
unwittingly deleting an existing file of the same name.  (You get your chance
to say yes, you *do* want to delete it.)


#32 of 35 by mdw on Mon Jan 8 09:48:14 1996:

Trailing spaces are always good for a laugh.
Also files that say: cat: cannot open <filename>


#33 of 35 by apollo on Fri Apr 25 16:45:55 2003:

Put the whole filename in quotes.


#34 of 35 by remmers on Fri Apr 25 23:08:41 2003:

Given that the item was posted almost 10 years ago, I suspect that
the problem has been dealt with by now.


#35 of 35 by cross on Fri Apr 25 23:32:38 2003:

Heh; that's a fairly common occurance on grex, or so it seems.  btw-
I was mildly surprised that no one mentioned rm - -i.  Before ``--''
became widespread as a means to stop argument processoring, rm was
blessed by recognizing a single - as a special case to aid in removing
files that start with `-'.

Response not possible - You must register and login before posting.

No Next Item No Next Conference Can't Favor Can't Forget Item List Conference Home Entrance    Help

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss