- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: How to get directory size?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2010 02:44 AM
тАО11-24-2010 02:44 AM
How to get directory size?
how to get particular directory size ?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2010 03:01 AM
тАО11-24-2010 03:01 AM
Re: How to get directory size?
try "du -sk ." while positioning yourself in the directory
or "du -sk /path/to/directory"
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2010 06:35 AM
тАО11-24-2010 06:35 AM
Re: How to get directory size?
ls -ld directory_name
du -ks directory_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2010 07:04 AM
тАО11-24-2010 07:04 AM
Re: How to get directory size?
By "directory size" I trust:
1.) How much space is the directory (folder?) occupying?
Ans: du -s -k /dirpath
du -s -k /dir/path/dirfolder
2.) Capacity of the directory/folder to hold files (in terms of MBytes, Gbytes or Tbyets?)
Ans: df -h /dirpath
df -h /dir/path/dirfolder
2.1) No of Files (aka inodes) capacity and usage -- i.e. how many files aer stashed in its placeholder filesystem
Ans: df -i /dirpath
df -i /dir/path/dirfolder
3.) How many files are contained there at?
Ans: df -i /dirpath (if dir/folder is a filesystem)
df -i /dir/path/dirfolder (if dir/folder is a filesystem)
ls -lR /dirpath | wc -l
ls -lR /dir/path/dirfolder |wc -l
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2010 08:49 PM
тАО11-24-2010 08:49 PM
Re: How to get directory size?
use du -sh (or) du -sk
see, below, U can get the directory size for /var/log
root@chitti # du -sh /var/log
102K /var/log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-10-2010 12:13 AM
тАО12-10-2010 12:13 AM
Re: How to get directory size?
The above command would give you the directory size of the directory
$ du -ah
This command would display in its output, not only the directories but also all the files that are present in the current directory. Note that 'du' always counts all files and directories while giving the final size in the last line. But the '-a' displays the filenames along with the directory names in the output. '-h' is once again human readable format.