Operating System - HP-UX
1826074 Members
3454 Online
109690 Solutions
New Discussion

rm files with queer characters

 
SOLVED
Go to solution
Ron Bombard
Frequent Advisor

rm files with queer characters

I have a few files in my "/" directory that have been unable to remove. Here's the type of file names:

-ef|grep rsta11
-ef|grep tofice
-ef|grep x1123

because of the "-" and the "|", I cannot seem to remove them. In the past I used to do a "ls -i" to get the inum for the files, then I'd do a
"find . -inum 172804 -ok rm -r {} \;"
to remove the inum. That dosen't seem to work anymore... like "ls" is not reporting the inum correctly. It just doesnt' find the file.

I've been able to login into the HPUX with a windows ftp client and delete file that way... but thats queer.

Any suggestions
Meddle not in the affairs of dragons... for you are crunchy and taste like chicken.
4 REPLIES 4
Jeff Machols
Esteemed Contributor

Re: rm files with queer characters

if the file name is hello-c.c

rm "hello\-c.c"

hello?.txt

rm "hello\?.txt"

harry d brown jr
Honored Contributor
Solution

Re: rm files with queer characters

use the -i option on rm, like this:

rm -i *

and step through the files to remove them manually.

live free or die
harry
Live Free or Die
Erik Allaert
Occasional Advisor

Re: rm files with queer characters

rm -i -- 'queer file name'

Laters
Ron Bombard
Frequent Advisor

Re: rm files with queer characters

Thanks all!
Meddle not in the affairs of dragons... for you are crunchy and taste like chicken.