1830226 Members
1677 Online
109999 Solutions
New Discussion

Cannot delete file

 
SOLVED
Go to solution
GraceO
Regular Advisor

Cannot delete file

I have a file that I'd like to delete that has weird characters in it. The exact name is ?^?^?^?^?^?^?^?^?^ and it exists in root. The owner is root and the group is sys. I don't know how it got there or if something is corrupted. Can someone help?
8 REPLIES 8
GraceO
Regular Advisor

Re: Cannot delete file

One more thing, the file does not appear when doing an ll command, but does with an ll | more.
Steven Schweda
Honored Contributor

Re: Cannot delete file

You might try something like "rm -i *", and
get ready to say "n" repeatedly. It's that,
or quote the weird name characters
appropriately.

Normally, I'd also suggest CTRL/C after you
get the thing deleted using "rm -i *", but
this is HP-UX, so it's always a mystery to
me which key does an interrupt. ("stty -a"
says, of course.)

(I assume that it's the file's _name_ that
has weird characters in it, not the file.)
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: Cannot delete file

Hi,

# ls -i

note the i-node number of the file

# find . -inum xxx -xdev -exec mv {}; /tmp/GraceO.ymp

Regards,
Robert-Jan
Yogeeraj_1
Honored Contributor

Re: Cannot delete file

hi,

if you have access through a graphics console or ftp software, you can try to rename it a more readable name and perform further analysis on the file characteristics.

hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Dennis Handly
Acclaimed Contributor

Re: Cannot delete file

This is a file with DEL chars.

If you use ll -b, you will see them as escapes. With my stty settings of ^H for erase, that is a regular char for me:
$ touch ^?
$ ll -b ^?
-rw-rw-r-- 0 Apr 3 23:31 \177
Jollyjet
Valued Contributor

Re: Cannot delete file

HI,

Rename the file and check the attributes and delete the file if it not works try to boot it in a single user mode and delete the file.
SANTOSH S. MHASKAR
Trusted Contributor

Re: Cannot delete file

Hi,

Note the inode of file by using command
ls -li

then use following to delete the file

# rm `ls -li|awk '$1 == {print $10}'`

Thats all


Otherwise use Steven's method.
GraceO
Regular Advisor

Re: Cannot delete file

Wow! So many options. I'll read carefully through them all and see which to try first.

Thanks everyone!