unable to delete a file

There is a file which has space in between .I dont knwo how that space came in between the file .-rw-rw-rw-1 jmc101bsp57611 Jan 14 08:04 log.bshell (jmc101@MANNYHow to delete this fileThanks
[225 byte] By [mdsadiq99] at [2007-11-25 23:19:10]
# 1
find . -name regexp for filename -exec rm {} \ should do the trick
dwlahiri at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 2
Have you tried:rm log.bshell\ \(jmc101\@MANNY
swoneill at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 3
If no other file starts with 1, you can do# rm 1*Or, use a backslash ( \ ) before every space in the name.# rm 1\ jmc101\ bsp ..... and so on.
Chaac at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 4
the exact cmd is:cd directory where the file isfind . -name log.bshell\* -exec rm {} \; that'll delete it.
dwlahiri at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 5
None of it works . It gives the same message. rm log.bshell (jmc101@MANNYsyntax error: `(' unexpected.Thx
mdsadiq99 at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 6

Wait ... your command below is missing the backslashes. These are rather important. It should look like this:

rm log.bshell\ \(jmc101\@MANNY

The backslash in front of the @ charater I don't believe is necessary but even if it isn't it doesn't hurt to be there. I don't think its necessary but you might try it like this:

rm - log.bshell\ \(jmc101\@MANNY

The dash says to rm that everything following the dash is simply argument data e.g. don't try to interpret anything as a switch. This helps in conditions with you have a -<filename> kinda condition. But there is no dash in your problem file name so this shouldnt' be necessary.

swoneill at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 7
nope . it doesnt work swoneill
mdsadiq99 at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 8

Try "rm -i log*" or "rm -i *" in the directory and say no to EVERYTHING except the file you want to delete. It's rather ugly, but it gets the job done. Oh, and before you listen some potential idiot like me who's telling you to use some variation of the "rm *" command, take a look at the man page and try it out in a test directory first. :)

Good luck!

spamly at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 9
I read all the other replies - have you tried:rm "log.bshell (jmc101@MANNY"It works here...Smilin'TimK
KraftT at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 10

Wait - I think I know what's going on - you have non-printable characters in the file name.

Do this:

ls -l > /tmp/listing.txt

Open the file listing.txt in vi and do ":set list"

I'll bet you will see control characters show up in the problem file's filename. Based on where the control characters are in the filename, you should able to figure out how to craft your rm command to deal with deleting the file correctly.

swoneill at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 11
If the find doesn't work you've got the syntax wrong. Worked everytime I tried it.
dwlahiri at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...
# 12
This discussion is going long. By the way the problem is solved and thanks to all . I think the solution of rm -i *" was the best solution for this problem.
mdsadiq99 at 2007-7-5 18:07:22 > top of Java-index,General,Talk to the Sysop...