Operating System - HP-UX
1822001 Members
4078 Online
109639 Solutions
New Discussion юеВ

Identifying and removing strage file

 
SOLVED
Go to solution
Brendan Newport_2
Frequent Advisor

Identifying and removing strage file

I have weird file in the home directory of a 10.20 (no, don't laugh!) server;

myserv:root:/home>ls -al
total 26
-rw-rw-rw- 1 clear sun 0 Oct 28 1999 ^[OC^[OC^[OC^[Ocd
drwxrwxrwx 60 sunadmin root 2048 Jun 30 11:06 .
drwxr-xr-x 28 daemon daemon 1024 Jun 30 04:24 ..
drwxrwxrwx 2 atlas sun 96 Oct 11 1999 atlas
etc etc

myserv:root:/home>file *
cd:C empty
atlas: directory
atlasint: directory
etc...

myserv:root:/home>find . -type f -user clear -prune
cdCCCC

myserv:root:/home>rm cdCCCC
rm: cdCCCC non-existent

myserv:root:/home>rm cdC*
rm: non-existent

myserv:root:/home>rm "cdC*"
rm: non-existent

myserv:root:/home>ls -al cdCCCC
cdCCCC not found

myserv:root:/home>find . -type f | grep cd
cdCCCC

And I could go around in circles.

Any clues as to what this "file" could be, and how it can be removed?

Ta!


Bren
4 REPLIES 4
Pete Randall
Outstanding Contributor
Solution

Re: Identifying and removing strage file

Bren,

The easiest way is to do a "rm -i *" and reply no to everything else but that file.


Pete

Pete
melvyn burnard
Honored Contributor

Re: Identifying and removing strage file

well it appears to b 0 bytes in size, so I would suspect a user (clear) in group sun tried to create a file and mad a load of typo's.

try doing ll *d to see if this is the only file ending in d, and then try rm -i *d to make sure.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
saju_2
Respected Contributor

Re: Identifying and removing strage file

Hi bren

Try this one...

First do a "ll" on the directory .In your case i think it comes as the first file in the directory.
then try this command
rm `ll |awk '{print $9}'|sed -n 2p`

Here "sed 2p" means 2nd line in the output.

But before doing this command make sure that it is the first file showing in ll command. Other wise find out which line it comes and replace 2 with that line number..

Make sure the backup of the direcotry is available with u..

Regards
CS
Olav Baadsvik
Esteemed Contributor

Re: Identifying and removing strage file

To remove the file do the following:

ls -li
this will show the inode-number for the file. Ex: 12234

Then use this command to remove it:

find . -inum 12234 -exec rm {} \;

Regards
Olav