priest@cs.odu.edu (Travis L Priest) (06/05/91)
hopefully someone finds this challenging: I recently had a file in my dirctory that was incidentally created by a program I ran. `ls` reported it's name as "N???BZ? " and upon trying to remove it, it logged me out. (I used file completion in tcsh to expand it's name, and I also used the wildcard N*). Using dired mode in emacs I was able to remove it with no problem, and I did notice that the filename consisted of a series of control codes. My question is: How do you remove a file whose name contains the "logout" control sequence using standard commands available to sh, csh, or tcsh (useful on a system that does not have emacs)? I do not know how to create the file again so that I can try to solve this problem, so if anyone knows how to do that, too, I would like to hear about it. --Travis-- Consultant ODU System's Group
lthompso@hpcc01.HP.COM (Larry L. Thompson) (06/06/91)
/ hpcc01:comp.unix.wizards / priest@cs.odu.edu (Travis L Priest) / 4:30 pm Jun 4, 1991 / hopefully someone finds this challenging: I recently had a file in my dirctory that was incidentally created by a program I ran. `ls` reported it's name as "N???BZ? " and upon trying to remove it, it logged me out. (I used file completion in tcsh to expand it's name, and I also used the wildcard N*). Using dired mode in emacs I was able to remove it with no problem, and I did notice that the filename consisted of a series of control codes. >My question is: How do you remove a file whose name contains the >"logout" control sequence using standard commands available to sh, >csh, or tcsh (useful on a system that does not have emacs)? I do not >know how to create the file again so that I can try to solve this >problem, so if anyone knows how to do that, too, I would like to hear >about it. > My favorite incantation for this kind of stuff is to remove the inode directly. You might be supprised to find out how many control and escape characters can be placed in a file. ls -i gives you the inode number of the file find . -inum <inode number> -exec /bin/rm {} \; Larry ------------------------------------------------------------------------------ Larry L. Thompson Hewlett-Packard Co. Unix: lthompso@hpcmfs.corp.hp.com 3500 Deer Creek Rd 26U-13 HPDesk: larry_l_thompson@hp0000 Palo Alto, CA. 94304 Tel: (415) 857-4437
zfgo01@hgo7.hou.amoco.com (F. G. Oakes) (06/07/91)
lthompso@hpcc01.HP.COM (Larry L. Thompson) writes: >/ hpcc01:comp.unix.wizards / priest@cs.odu.edu (Travis L Priest) / 4:30 pm Jun 4, 1991 / >I recently had a file in my dirctory that was incidentally created by >a program I ran. `ls` reported it's name as "N???BZ? " and upon >trying to remove it, it logged me out. >>My question is: How do you remove a file whose name contains the >>"logout" control sequence using standard commands available to sh, >>csh, or tcsh ... You might try archiving everything in it's (the file's) home directory, except the file itself into a temporary file, move up a level, remove the directory, make it back, and restore the files from the archive. This assumes you can exclude the problem file with egrep, etc. -- ============================================================================ zfgo01@hgo7.hou.amoco.com (Glen Oakes)
jjp@necis.UUCP (Jeff Phillips) (06/08/91)
In article <1991Jun4.233032.14860@cs.odu.edu> you write: > >I recently had a file in my dirctory that was incidentally created by >a program I ran. `ls` reported it's name as "N???BZ? " and upon >trying to remove it, it logged me out. >[...] >My question is: How do you remove a file whose name contains the >"logout" control sequence using standard commands available to sh, >csh, or tcsh (useful on a system that does not have emacs)? I do not >[...] Have you tried "rm -rif ./*" ? Answer 'n' when prompted for removing all the other files in the directory, and 'y' when prompted for the file you want to delete. -- @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ Jeffrey J. Phillips UUCP: jjp@necis.nec.com @@ @@ NEC Technologies, Inc. PHONE: (508)635-6077 @@ @@ "UNIX isn't a philosophy, it's a way of life" - anon @@ @@ CASUAL DISCLAIMER: Opinions are mine - definitely not corporate policy @@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
andyb@stb.info.com (Andy B.) (06/11/91)
> lthompso@hpcc01.HP.COM (Larry L. Thompson) writes: > > >/ hpcc01:comp.unix.wizards / priest@cs.odu.edu (Travis L Priest) / 4:30 pm Jun 4, 1991 / > > >I recently had a file in my dirctory that was incidentally created by > >a program I ran. `ls` reported it's name as "N???BZ? " and upon > >trying to remove it, it logged me out. > > >>My question is: How do you remove a file whose name contains the > >>"logout" control sequence using standard commands available to sh, > >>csh, or tcsh ... How about "rm -i *" ? Or you might try unlink. Andy -- If it's not broken...your girlfriend will get bored with it anyway.