1833036 Members
2664 Online
110049 Solutions
New Discussion

file deletion

 
SOLVED
Go to solution
Edgar Zapata
Esteemed Contributor

file deletion

how can I delete a file named -liat that I found in my folder. I know it's harmless, but still don't want it there.
I have tried rm -i * but it won't work.
We use HP-UX 10.20
regards.
4 REPLIES 4
Muthukumar_5
Honored Contributor

Re: file deletion

We can delete it as,

file name = -liat

find -name "-liat"
It will give the file name
find -name "-liat" -exec rm -i {} \;

It will do it.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor
Solution

Re: file deletion

And another more from rm man page,

---------------- man rm ---------
Remove a file in the current directory whose name starts with - or *
or some other character that is special to the shell:
rm ./-filename

-----------------------------------
Use rm -i /-liat

It will delete it.
Easy to suggest when don't know about the problem!
Jose Mosquera
Honored Contributor

Re: file deletion

Hi,

rm ./-liat

Rgds.
Michael Duthie
Trusted Contributor

Re: file deletion

Or open a CDE session and do some Bill Gates point click delete type stuff. :-)