|
|
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.
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.
(She's dividing us into those lower than a twit, and higher than a twit.)
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.
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.
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. ;-)
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.
This response has been erased.
Speaking of indestructible files, I acidentially saved a game as !saved on /u/vidar and have not been able to get rid of it.
This response has been erased.
I'm no UNIX wizard, but wouldn't the backslash character be useful in these situations?
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?
(If you know the answer, should you say?)
rm ./-i works just fine
This response has been erased.
<evil grin>
How? How?
By manipulating my mouth, stupid.
!twit vidar how? how?
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...
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?
This response has been erased.
*RE: 11:*] how? how?
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.)
Mea culpa. I was confused by response 14 and the lack of responses afterwards. I'll have to go try it out now!
By the way, is there an actual rm-file I can invoke to get around having aliased it to 'rm -i'?
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".
Also, if you put a backslash before any command, it turns off the aliasing, i.e. "\rm filename"
Using the 1 helped me destory registration.
How do I change the name of a file already existing in my directory? (thanks)
mv filename newfilename mv for "move", you can also use it to move a file to a new directory.
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.)
Trailing spaces are always good for a laugh. Also files that say: cat: cannot open <filename>
Put the whole filename in quotes.
Given that the item was posted almost 10 years ago, I suspect that the problem has been dealt with by now.
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.
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss