Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

4 Answers

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.

share|improve this answer
add comment

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?

share|improve this answer
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
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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