Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!sol.ctr.columbia.edu!emory!hubcap!ncrcae!ncr-sd!se-sd!rns From: rns@se-sd.SanDiego.NCR.COM (Rick Schubert) Newsgroups: comp.unix.admin Subject: Re: help removing a file Message-ID: <3812@se-sd.SanDiego.NCR.COM> Date: 7 Sep 90 17:04:19 GMT References: <1990Sep5.180847.21767@zaphod.mps.ohio-state.edu> Distribution: usa Organization: NCR Corporation, Systems Engineering - San Diego Lines: 29 In <1990Sep5.180847.21767@zaphod.mps.ohio-state.edu> harmon@function.mps.ohio-state.edu (Jim Harmon) writes: >Could someone someone help me with removing a file. On our system we have a >file that appears as zhang?evai.tex when doing a `ls` but a tab completion >says it's zhangNevai.tex. I've tried putting a back slash in front of the ? >and quoting the whole name. I even tried doing `rm -i *` and it matches >zhangNevai.tex but says there's No such file or directory. I've seen about 6-8 follow-ups to this question, and none gave a very general solution (some might work with some versions of `ls' and/or some shells and/or some versions of `find' some might work depending on what the non-printable characters are, while others won't work at all, anywhere). The most general solution is to execute (assuming you are in the directory with the offending file): rm -ri . Then `rm' will prompt you for each of the files in the current directory and those under it (unfortunately, although if you answer "n" when it first encounters the directory, `rm' will not traverse the subdirectory). Answer "n" to all of those except the one(s) you want removed. The key is to avoid generating the filename on the command line (with or without wildcards). I was surprised to see this question posted to comp.unix.admin, but I was even more surprised at the poor quality of the answers. But I don't mean to start a flamefest. -- Rick Schubert (rns@se-sd.sandiego.NCR.COM)