Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
cancel
Showing results for 
Search instead for 
Did you mean: 

remove file name "."

ahsiangsiang
Occasional Contributor

remove file name "."

Hi,

I have file with name "." and it is not root directory but a file

how can i remove it and my FTP fail because of this file with name "."

please check my attachment.

Billion Thanks
8 REPLIES
George_Dodds
Honored Contributor

Re: remove file name "."

Been quite a few threads on removing files starting with special characters.

Take a look at this one

http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1244770620964+28353475&threadId=100983

Cheers

George
Nido
Trusted Contributor

Re: remove file name "."

Hi,

do listing in the current directory with `-il` and find the inode of the file. and remove the file if you feel its of no use.

ls -li

#find . -inum -exec rm {} \;

Nasty One:
or do a # rm -i * < on the current Directoy>
It'll prompt for every file in the directory say y to the file you want to delete.


example:
$ rm -i *.job
rm: Remove test.job? n
rm: Remove test1.job? n
rm: Remove test2.job? n

Cheers!!
" Let Villagers Be Happy!! "
Nido
Trusted Contributor

Re: remove file name "."

Oops: I wanted to add some more lines:
An additional info about . and .. directory files.

Please check : man glossary

GLOSSARY ENTRIES
. (dot) A special file name that refers to the current
directory. It can be used alone or at the beginning of
a directory path name. See also path name resolution.
The dot also functions as a special command in the
Bourne and Korn shells, and has special meaning in text
editors and formatters, in parsing regular expressions
and in designating file names.

.. (dot-dot) A special file name that refers to the parent
directory. If it begins a path name, dot-dot refers to
the parent of the current directory. If it occurs in a
path name, dot-dot refers to the parent directory of
the directory preceding dot-dot in the path name
string. As a special case, dot-dot refers to the
current directory in any directory that has no parent
(most often, the root directory). See also path name
resolution.

Cheers!!
" Let Villagers Be Happy!! "
Steven Schweda
Honored Contributor

Re: remove file name "."

> I have file with name "." [...]

Seems unlikely. Perhaps ". " or ". ", ...

> please check my attachment.

A JPEG image? You couldn't copy and paste
the text?
Dennis Handly
Acclaimed Contributor

Re: remove file name "."

To find invisible chars in the name you can use:
ll -b | vis -t
ahsiangsiang
Occasional Contributor

Re: remove file name "."

Hi Dennis,

hpenqb::root>ll -b | vis -t
total\s1771024
-rw-rw-r--\s\s\s1\spba4r\s\s\s\s\s\susers\s\s\s\s\s\s\s\s\s3584\sApr\s\s8\s10:27\s.\\015

here is the output. What to do next? Thanks
ahsiangsiang
Occasional Contributor

Re: remove file name "."

Hi Nido,

Thanks for your command. It work! Thanks
Dennis Handly
Acclaimed Contributor

Re: remove file name "."

>here is the output. What to do next?

It looks like the file is "." followed by a CR.
Inside a script you can do:
ll -b .^V^M
rm .^V^M

Where that's control-V then control-M.