You are not logged in.

#1 2010-08-25 16:59:12

fettouhi
Member
Registered: 2007-05-07
Posts: 745

[SOLVED] Deleting a file with missing chatracters in filename

I have a file named -+.txt and I can't delete it from my system. I've tried to rename it first and using --force but I simply can't delete it.

Last edited by fettouhi (2010-08-25 17:05:05)

Offline

#2 2010-08-25 17:04:41

fettouhi
Member
Registered: 2007-05-07
Posts: 745

Re: [SOLVED] Deleting a file with missing chatracters in filename

Figured it out!

Offline

#3 2010-08-25 17:05:16

egan
Member
From: Mountain View, CA
Registered: 2009-08-17
Posts: 273

Re: [SOLVED] Deleting a file with missing chatracters in filename

In many gnu programs, passing the flag -- to the program tells it to stop looking for further flags. This is what you need since the programs are interpreting your file as an option. Thus:

rm -- -+.txt

should do the trick.

EDIT:
Too slow! big_smile

Last edited by egan (2010-08-25 17:05:35)

Offline

#4 2010-08-25 17:05:27

milomouse
Member
Registered: 2009-03-24
Posts: 940
Website

Re: [SOLVED] Deleting a file with missing chatracters in filename

rm -- -+.txt

edit: too slow :{

Last edited by milomouse (2010-08-25 17:05:41)

Offline

#5 2010-08-25 17:06:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Deleting a file with missing chatracters in filename

Would you mind posting the solution to your problem? It's quite irritating to see just 'Figured it out!'.

Last edited by karol (2010-08-25 18:43:02)

Offline

#6 2010-08-25 17:06:35

shemz
Member
Registered: 2010-04-23
Posts: 135

Re: [SOLVED] Deleting a file with missing chatracters in filename

its a virus tongue
Permissions? From man rm:

To  remove a file whose name starts with a '-', for example '-foo', use one of these commands:
          rm -- -foo
          rm ./-foo

Edit: Last smile

Last edited by shemz (2010-08-25 17:07:33)

Offline

Board footer

Powered by FluxBB