Last night I had a Dovecot server lock up and it corrupted a file in a user's maildir. The file name now has special characters in it and can't be deleted, all command line tools say the file cannot be found, even though it shows up via the LS command.
1386141318.M854059PΈ3Ώ62.email.vantagetitle.com,S?11304,W11473:2,Sc
You can see the special characters in the name such as "Ώ" or "Έ".
I can't seem to find any way to remove this file.
should I do an fsck
?
EDIT 1:
I ended up making a new "cur" directory and moved all of the good emails over to it. I renamed the old "cur" directory to "bad cur"
I have tried the following...
sh-3.2# rm -rf badcur
rm: badcur: Directory not empty
sh-3.2# cd badcur
sh-3.2# ls
1386141318.M854059PΈ3Ώ62.email.vantagetitle.com,S?11304,W?11473:2,Sbc
sh-3.2# rm -rf 1386141318.M854059PΈ3Ώ62.email.vantagetitle.com,S?11304,W?11473:2,Sbc
sh-3.2# ls
1386141318.M854059PΈ3Ώ62.email.vantagetitle.com,S?11304,W?11473:2,Sbc
sh-3.2# ls -i
ls: 1386141318.M854059PΈ3Ώ62.email.vantagetitle.com,S?11304,W11473:2,Sbc: No such file or directory
sh-3.2#
You could try using
-i
which will present you with a questionand answer
y
You may be able to delete the file using it's inode number. use
ls -li
to get the inode number of the file. Once you have it, use find to delete itThe easiest way to tackle these is to use a double-dash (--) following the rm.
The double-dash tells the command rm that you are done passing command switches and what follows is what its supposed to operate on.
-Scott
If present, you could browse the directory with Midnight Commander.
Enter
mc
, use the arrow keys to select the file and then hitF8
to delete itSounds broken, unmount the file system and run the correct version of
fsck
for your file system.Probably
fsck.ext3 /dev/sdaN
Run a
df .
in the directory if you don't know which file system your on.Run
mount
if you don't know the correct type of the file system.If you have a GUI available, try using the GUI to delete the file.
I mistakenly tried to
tar xvf
a Windows ZIP file. It spat out a bunch of errors and then I had this 0 byte file in place of the extracted files, with a crazy long name with question marks representing non-printable characters/values.I used the standard GUI file browsing tool in Gnome to send the file to the Trash, and then went to the Trash, using the GUI, to permanently delete the file, in case the file could possibly cause any sort of errors by remaining in the Trash.