Operating System - HP-UX
1838660 Members
11356 Online
110128 Solutions
New Discussion

problem with strange file

 
SOLVED
Go to solution
Luca Frigatti
Contributor

problem with strange file

Hi all!
On HP-UX 10.20 I have the following problem.
In one directory on my server I saw some file in the followin format :
@^DM-^V0@^DM-fM-|
Are there any way to delete them?
Thanks in advance for your help and your support.
5 REPLIES 5
Robin Wakefield
Honored Contributor

Re: problem with strange file

Hi Luca,

cd to the directory, then issue:

rm -i *

this will run the rm in interactive mode, therefore answer no to all the files expect the one you wish to remove.

I'm assuming there aren't that many files in this directory, otherwise you may have to refine the wildcard.

Rgds, Robin
John Carr_2
Honored Contributor

Re: problem with strange file

Hi

try an asteric and some sensible characters until you get a listing of the just the files you want to zap ie

ls *DM*

or

ls *DM*DM*

if the listing is just the unwanted files

do rm *DM* ( or your ls string )

good luck
John.
Olav Baadsvik
Esteemed Contributor
Solution

Re: problem with strange file

Hi,

To avoid using * as argument to rm
you can use this method.

cd to the directory
ls -li
this will give you the inode-number for
the files. You can then use the inode-number
in find to delete the file. In this way
you specify one (and only one) file:
Example:

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

Olav

federico_3
Honored Contributor

Re: problem with strange file

find the i-node number with:

ls -i

you'll get the inode numbers N

remove using:

find DIR -type f -inum N -exec rm {} \;


Ciao
Federico
Darrell Allen
Honored Contributor

Re: problem with strange file

Hi Luca,

I presume you've already deleted the file but...

If you can enter "ls @*" without a problem, then you can do "rm -i @*".

The only special purpose I'm aware of for the "@" character is that it has been used on some systems as stty's kill character (what you enter when typing a command and decide you want to erase the entire line you are typing and start over). Most systems today use ^U (
If you can not enter @ on your terminal, use "stty" to see what your kill character is set to. You can change it with "stty kill ^U" and then you should be able to enter "rm -i @*" without a problem.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)