how delete a special file

if i have a file named "."
how to delete it.
thanks .

please ls your directory

 844528
-rw-rw-r--   1 admin admin         0  4  1 19:42 �
-rw-rw-r--   1 admin admin       106  4  1 19:42 client.conf
-rw-------   1 admin admin  25616384  4  8 17:02 core.15658
-rw-rw-r--   1 admin admin 644616649  4  8 22:02 crawler.log

Please list again: This "sed" makes funny characters visible. It is not possible to have a file called "." so there must be some hidden characters.

ls -la | sed -n l
drwxrwxr-x   7 admin admin      4096  4\346\234\210  8 22:09 \033[00;\
34m.\033[00m$
drwxr-xr-x   6 admin admin      4096  4\346\234\210  8 09:42 \033[00;\
34m..\033[00m$
-rw-rw-r--   1 admin admin         0  4\346\234\210  1 19:42 \033[00m\
\302\267\033[00m$

Please do

$ find .

in your directory

if i use the command "find ."
there is a item below:
./.

Ok, what's the output of the following command ?

ls -al | perl -lane 'print "$F[0] $F[$#F]" if /\.$/'

tyler_durden

Or if you don't have Perl, then what's the output of the following 2 commands ?

ls -al | awk '/\.$/'
ls -al | awk '/\.$/{print $1, $NF}'

find options/syntax may be different depending on your OS/platform

In the directory containing the file:

$ ls -lai  ### to list the inodes
$ find . -inum <inode_number_of_dot_file> -exec ls -la {} \;

if it only returns that file as the result, and you know you don't need the file

$ find . -inum <inode_number_of_dot_file> -exec rm {} \;

or rename it to a more usable/appropriate name if still needed:

$ find . -inum <inode_number_of_dot_file> -exec mv {} <newname> \;

thanks it's this file:
-rw-rw-r-- 1 admin admin 0 4\346\234\210 1 19:42 \033[00m\
\302\267\033[00m$

then how can i remove it .

any idea will be appreciated

find alone isn't very helpful, when it comes to spotting characters that don't print. either pipe it through methyl's sed suggestion, or use something like:

find . -mindepth 1 -maxdepth 1 -print0 | od -cb

---------- Post updated at 10:38 AM ---------- Previous update was at 10:28 AM ----------

An example that may be helpful to you:

$ touch "$(printf '.\001\002\003')"
$ find . -mindepth 1 -maxdepth 1
./.
$ find . -mindepth 1 -maxdepth 1 -print0 | od -cb
0000000    .   /   . 001 002 003  \0                                    
          056 057 056 001 002 003 000                                    
0000007
$ rm "$(printf '\056\057\056\001\002\003')"
$ find . -mindepth 1 -maxdepth 1 -print0 | od -cb
$ # Strangely named file is now gone

Also, if this odd file is the only one in the directory, you might be able to delete it with a simple:

rm *

or

rm .*

Regards,
Alister

thanks , i need to go back to my dormitory now.
i will deal with it tomorrow.
thanks

Unless I missed something important . and .. are files created by the mkdir command.
Normally ls does not show them. It does for you.

I am guessing that somehow a '.' file - possibly with non-printing characters in the file name - has been created. Which some other posters are assuming is the case.

I would like to point out:
If it is really just a dot ('.') then the directory is hosed. (or something unpleasantly interesting happened to the ls command) You may have to resort to fsck (or whatever utility you use) to fix filesystems. One way to see if this is the case is to follow madmat's suggestion.

I guess that the Escape sequences are something to do with formatting your local "ls". Not seen that before myself. The Chinese names in the directory listing are also outside of my experience.
I have highlighted what I think are the three filenames in this listing. The normal "." and ".." which we expect in every directory and a weird file with a two-character name.

We can test this theory.
# Generate the filename.
WEIRD=`echo "\0302\0267\c"`
# See if we can find it.
ls -lad "${WEIRD}" | sed -n l
# If we found the filename, we can rename it
mv "${WEIRD}" junkfile
# Then delete it
rm junkfile

thanks for the all warmhearted people.
i follow your tips and deal with it .