Operating System - HP-UX
1841224 Members
2495 Online
110179 Solutions
New Discussion

How to delete ghost file?

 
Chen Yingjie
Frequent Advisor

How to delete ghost file?

There is a ghost file in
our server.

When I use "ls" command, it
appeared, but when I use "ll"
command, it shows the file is
not found.

How can I delete this file?

Thanks advice.
6 REPLIES 6
malay boy
Trusted Contributor

Re: How to delete ghost file?

Hi,

use rm -i *.This will enable you to delete the file interactively.The command will prompt like below :

file1: ? (y/n) n
: ? (y/n) y

Just type 'Y' to delete the file or 'N' if this is not the ghost file.

IN above example , you see there are blank file name which I wish to delete.

regards
mB
There are three person in my team-Me ,myself and I.
malay boy
Trusted Contributor

Re: How to delete ghost file?

This member has assigned points to 7 of 143 responses to his/her questions.

Chen,
Please assign point for those who help you.


regards
mB
There are three person in my team-Me ,myself and I.
V.Tamilvanan
Honored Contributor

Re: How to delete ghost file?

Hi,

1. Find the inode number of the file by
#ls -i

2.Delete the file by using find .
#find . -inum Inodenumber -exec ll {} \;

where Inodenumber is the corresponding inode number of your ghost file what u got in step 1.

HTH
-tamil
V.Tamilvanan
Honored Contributor

Re: How to delete ghost file?

Hi,

1. Find the inode number of the file by
#ls -i

2.Confirm the file by
#find . -inum Inodenumber -exec ll {} \;

3.Delete the file by
#find . -inum Inodenumber -exec rm {} \;


where Inodenumber is the corresponding inode number of your ghost file what u got in step 1.

HTH
-tamil
V.Tamilvanan
Honored Contributor

Re: How to delete ghost file?

Hi,

1. Find the inode number of the file by
#ls -i

2.Confirm the file by
#find . -inum Inodenumber -exec ll {} \;

3.Delete the file by
#find . -inum Inodenumber -exec rm {} \;


where Inodenumber is the corresponding inode number of your ghost file what u got in step 1.

HTH
-tamil
Massimo Bianchi
Honored Contributor

Re: How to delete ghost file?

Hi,
try also with:


ls -b *

so you will see unprintable charachters...

Massimo