Search code examples
linuxsystem-administrationrm

can't delete directory under linux due to broken files


kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al
ls: cannot access post-commit: No such file or directory
ls: cannot access update: No such file or directory
ls: cannot access post-update: No such file or directory
ls: cannot access commit-msg: No such file or directory
ls: cannot access pre-rebase: No such file or directory
ls: cannot access post-receive: No such file or directory
ls: cannot access pre-applypatch: No such file or directory
ls: cannot access pre-commit: No such file or directory
total 8
drwxrwxr-x 2 kt kt 4096 2008-09-09 18:10 .
drwxrwxr-x 4 kt kt 4096 2008-09-09 18:10 ..
-????????? ? ?         ?            ?                ? commit-msg
-????????? ? ?         ?            ?                ? post-commit
-????????? ? ?         ?            ?                ? post-receive
-????????? ? ?         ?            ?                ? post-update
-????????? ? ?         ?            ?                ? pre-applypatch
-????????? ? ?         ?            ?                ? pre-commit
-????????? ? ?         ?            ?                ? pre-rebase
-????????? ? ?         ?            ?                ? update

Solution

  • First off, here's your question, nicely formatted (surround it in < pre > tags to get this):

    kt@rails-ubuntu:~/rails/ledger/releases/20080820144914/.git/hooks$ ls -al
    ls: cannot access post-commit: No such file or directory
    ls: cannot access update: No such file or directory
    ls: cannot access post-update: No such file or directory
    [snip]

    Anyway, you need to boot up in single-user mode and run fsck. If you can't reboot right now, just move the directory to /tmp and forget about it.