Computing.Net > Forums > Linux > Reset Directory Size in Linux

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Reset Directory Size in Linux

Reply to Message Icon

Name: amgquik
Date: September 19, 2005 at 15:44:55 Pacific
OS: Linux Red Hat Enterprise
CPU/Ram: 2GB
Comment:

I emptied a directory and the size of it does not change, it still says the previous size. Is there a way to reset the size of a directory?



Sponsored Link
Ads by Google

Response Number 1
Name: 3Dave
Date: September 20, 2005 at 01:48:47 Pacific
Reply:

What size does it say it is? How are you getting the size? "ls -l" or through a graphical interface? You can find the size of a directory with "du -hs /path/to/directory". The "h" means to display in human readable format (eg 4.5K, 1.6M, 12G etc) and the "s" supresses the output of every recursive directory so you just get the one total size for the lot.


0

Response Number 2
Name: 3Dave
Date: September 20, 2005 at 01:49:57 Pacific
Reply:

Just thought....are there ant hidden files in there? You can list them with "ls -a", hidden files and directories start with a "."


0

Response Number 3
Name: Dlonra
Date: September 20, 2005 at 05:40:42 Pacific
Reply:

directories are files which never shrink.
A directory "file" contains the names of its files and other info.
On my linux, minimum directory size is 4096.
If the number of files in the directory gets large enough, the size expands in multiples of 4096.

If all the files in the directory are removed, ls -ld Dir will still give the same size.

rmdir Dir; mkdir Dir
minimizes



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Linux-Ready Controller Bo... Unable to mount the CD-RO...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Reset Directory Size in Linux

Explorer in linux? + add an HD www.computing.net/answers/linux/explorer-in-linux-add-an-hd/24027.html

up one directory in linux?? HOW? www.computing.net/answers/linux/up-one-directory-in-linux-how/18680.html

No sound in Linux-Mandrake 7.2 www.computing.net/answers/linux/no-sound-in-linuxmandrake-72/3053.html