On my OS X host, I am having trouble deleting the directory "foo".
mymac:.Trashes joe$ ls
foo
mymac:.Trashes joe$ ls foo/
Ảnh011.jpg Ảnh012.jpg Ảnh013.jpg
mymac:.Trashes joe$ ls -l foo/
ls: Ảnh011.jpg: No such file or directory
ls: Ảnh012.jpg: No such file or directory
ls: Ảnh013.jpg: No such file or directory
mymac:.Trashes joe$ rm -rf foo/
rm: foo/: Directory not empty
mymac:.Trashes joe$ sudo rm -rf foo/
Password:
rm: foo/: Directory not empty
As you can see, there are some files under the directory "foo" which I can only run ls
on; running ls -l
returns an error. I cannot delete the individual files or the directory. Using "Empty Recycle Bin" did not work either. I have also tried 'Disk Utility' -> 'Verify Disk' and 'Repair Disk'.
Edit: As requested, here are more info
mymac:.Trashes joe$ ls -del foo/
drwxrwxrwx 2 joe staff 16384 13 May 11:19 foo/
mymac:.Trashes joe$ ls -del foo
drwxrwxrwx 2 joe staff 16384 13 May 11:19 foo
mymac:.Trashes joe$ LC_ALL=C
mymac:.Trashes joe$ ls -ABeli foo/
total 1812
18972612676 -rwxrwxrwx 1 joe staff 305951 13 May 11:19 Ảnh011.jpg
19123958587 -rwxrwxrwx 1 joe staff 309745 13 May 11:19 Ảnh012.jpg
18511775654 -rwxrwxrwx 1 joe staff 310907 13 May 11:19 Ảnh013.jpg
mymac:.Trashes joe$ find foo/
foo/
foo//Ảnh011.jpg
foo//Ảnh012.jpg
foo//Ảnh013.jpg
cd
ing into the directory and doing something likerm -f -- ./*
work? (I'm not sure if OSX's rm accepts the -- syntax to terminate command line processing for arguments, but don't see why it shouldn't.) – user May 15 '12 at 14:53rm
is aliased to something. Try/bin/rm
instead. – hluk May 15 '12 at 16:09find foo/ -type f -delete
. – hluk May 15 '12 at 16:24\ls -del foo
,LC_ALL=C \ls -ABeli foo/
,find foo/
. Copy-paste the output into your question. – Gilles 'SO- stop being evil' May 15 '12 at 23:26