Results 1 to 9 of 9
I wish I knew how this one happened, but fixing it is giving me nightmares.
At work, we run Spamassassin as a daemon under Exim. So far, so good. But ...
- 05-17-2004 #1Just Joined!
- Join Date
- Apr 2004
- Location
- Montrose, CO USA
- Posts
- 7
Removing a file that has an illegal filename
I wish I knew how this one happened, but fixing it is giving me nightmares.
At work, we run Spamassassin as a daemon under Exim. So far, so good. But recently, we got two spam emails in that look like this:
(The number string before the first underscore is something Exim adds.)Code:1084295179_"COPS04-040511170744Z-33702*-PRMD=C.O.P.S.-ADMD= -C=US-"@MHS 1084302537_"COPS04-040511191019Z-34501*-PRMD=C.O.P.S.-ADMD= -C=US-"@MHS
The issue is the " -C=US-" thing, which is a space followed by a -C. Every basic program on Linux, from cp to mv to rm is treating this as a command flag when it is not. This has totally screwed up my admin scripts.
Is there any way I can remove this file from the command line?
- 05-17-2004 #2Linux Guru
- Join Date
- Mar 2003
- Location
- Wisconsin
- Posts
- 1,907
You should be able to replace the space with '\ ' (minus the ', that's a slash space), and then replace '-' with '\-' (minus the ').
FYI, dashes are not illegal characters for file names. They just make it a pain in the [insert favorite curse here].
Hope that helps!
JeremyRegistered Linux user #346571
"All The Dude ever wanted was his rug back" - The Dude
- 05-17-2004 #3Just Joined!
- Join Date
- Apr 2004
- Location
- Montrose, CO USA
- Posts
- 7
Thank you! I'll give that a shot.
It's always something simple, you know?
- 05-17-2004 #4Linux User
- Join Date
- Jan 2004
- Posts
- 357
You can also use quotes around the name. I actually belive that single or double quotes will work, but your distro might wan't one over the other. Single works well under Redhat / Fedora.
something like
That would move a file called file name.txt to the directory /home/meCode:mv 'file name.txt' /home/me
- 05-17-2004 #5Linux Guru
- Join Date
- Mar 2003
- Location
- Wisconsin
- Posts
- 1,907
The solution is only simple if it works!Code:It's always something simple, you know?
That's why were here. Good luck!
JeremyRegistered Linux user #346571
"All The Dude ever wanted was his rug back" - The Dude
- 05-17-2004 #6And you always look back on it and say, "Now why didn't I think of that in the first place?"
Originally Posted by jeremy1701
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
- 05-18-2004 #7Just Joined!
- Join Date
- Apr 2004
- Location
- Montrose, CO USA
- Posts
- 7
Trust me, I know how that is.
Unfortunately, neither escape characters or quotes worked. (I think I know why, though.)
However, logging into the GUI directly on the box itself allowed me to just use Nautilus to get rid of the offending files.
Either way, my problem is solved. Thank you all very much for the help!
- 05-22-2004 #8Linux Newbie
- Join Date
- Feb 2004
- Location
- India
- Posts
- 132
You could have used mc
Midnight Commander
You are the one Linux!
- 05-23-2004 #9Just Joined!
- Join Date
- Apr 2004
- Location
- Montrose, CO USA
- Posts
- 7
D'oh! Why didn't I think of that? Maybe I should install it...


Reply With Quote