2

I am using following command to check the disk usage in my home direcory.

du -sk * | sort -n

I am getting the following output

273240  AQP
707720  oradiag
3176872 J2EEServer
23628720        var
100000910

I get a directory of size 100000910 without a name in the last line . How can I access/delete this ghost directory in my home directory.

1
  • I have only 4 folders in my home directory .I don't know from where I am getting that extra line. – g4ur4v Nov 9 '12 at 10:09
6

The directory name might be composed of space characters (spaces, tabs...). With GNU coreutils (linux standard) use ls -Q which will put the filenames into quotes. Or check with a filemanager like Midnight Commander.

2

Maybe the name of the directory is ? (that is a space, or a tab). This is a perfectly correct Unix filename. Why don't you run

ls -Ql

And check for yourself?

2
  • 1
    With ls -l, you will be able to see the directory, but no way of know if its one space, to spaces, a tab, etc. – jordanm Nov 9 '12 at 14:56
  • good point. I add the -Q option. – January Nov 9 '12 at 15:08
2

It is possible that the file is composed entirely of non-printable or whitespace characters. You can probably see it using printf '<%q>\n' *.

You should be able to get the inode number using ls -il. After that, you can remove it by using something like find . -xdev -maxdepth 1 -inum 1234 -delete. Given its size, the directory is probably not empty; you can change into it to examine it with cd "$(find . -xdev -maxdepth 1 -inum 1234)" to examine the contents at your leasure.

0

I would recommend ls -al see if the file is there as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.