3

I wrote a Perl script and fat-fingered the name of my output file inserting a space in the file name, so now I have my_file .txt I have tried the following with no success (and no errors reported):

rm ./my_file\ .txt
rm "./my_file .txt"
find . -inum 123 -exec rm -i {} \;

None of the above removes the file, nor do I receive an error, warning, etc. I own the file, the directory, and have the appropriate permissions. The filehandle is closed and lsof ./my_file\ .txt does not show the file in use elsewhere. My google fu has failed me, so thanks in advance for any help you can offer.

EDIT: output of stat:

$ stat my_file\ .txt
  File: `my_file .txt'
  Size: 4096            Blocks: 8          IO Block: 4096   regular file
Device: fd00h/64768d    Inode: 16613511    Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 4939/ abc1111)   Gid: (  100/  ABware)
Access: 2013-07-02 09:27:32.000000000 -0500
Modify: 2013-07-02 10:57:21.000000000 -0500
Change: 2013-07-02 10:57:21.000000000 -0500
An Dorfer
  • 1,178

1 Answers1

4

The most surefire way to delete things with weird names is to use find's -delete action. For example

find . -inum 16613511 -delete 

or

find . my_file?.txt -delete 
terdon
  • 54,564