Originally Posted by ralgal
The output of the
ls -ld /home/user1/logs
drwxr-xr-x 2 user1 user1 4145152 Dec 16 2010 /home/user1/logs
The directory is completely empty.
Assuming an ext[2|3|4] file-system: The brown part does not indicate the size of the content of the directory, it tells you the size of the the directory entry itself (meta-data about files, including the file names contained in that directory). This is always a multitude of the block-size used on the system (4096 on most modern systems). In this case 1012 blocks are/where needed at some point.
If you empty a directory these blocks are not reduced. This is a feature (or problem if you want) of the ext2/3/4 file system. The only easy way to reduce the amount of blocks assigned is to delete the directory and re-create it again.
du -sh *
in the home directory and it shows the size of /home/user1/logs as 3.8M.
Can someone please tell me how i can reduce the size, or what that size means? (i tried ls -al and there are no hidden folders)
Deleting files in a directory doesn't necessarily reduce the content size of that directory to zero. This can happen when a running program still has a pipe to a (former) file in that directory. The file is still kept open by the program even though the file isn't visible.
You can use the lsof
command to find out if a file is kept open:
lsof | grep /home/user1/logs
(you might need to run the above as root user).