• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

total amount of octets used in a directory

I don't know if there's an unix command giving the total number of octets (or inode) used by all the files in a directory (and its subdirectory...)???
thanks.
0
steph84
Asked:
steph84
  • 4
  • 2
1 Solution
 
seedyCommented:
du gives you the disk utilization of files.  
'du -s -k .' will give you the number of 1kb blocks that is used by all the files and subdirectories in the current directory.

inode:  Do you want to know how many inodes are used up?  One per file!
0
 
seedyCommented:
du gives you the disk utilization of files.  
'du -k *' will give you the number of 1kb blocks that is used by each of the file or the files under the directory in the current directory.

inode:  Do you want to know how many inodes are used up?  One per file!
0
 
steph84Author Commented:
perfect you should answer that i grade you!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
braveheartCommented:
"du -k" performs a recursive directory search and gives the answer in Kb.

"ls -l" gives the answer in bytes (octets) but you have to specify each directory (unless you are only interested in the current directory), with or without wildcards, on the command line.

"ls -i" will print the inode number of each file (one per file) in the first column of the report.
0
 
seedyCommented:
braveheart, I hope you did not mean to do that!
steph84,  if you want to award the points to me, you should reject  braveheart's answer to reopen the question for me.

0
 
braveheartCommented:
seedy, your answer gives the result in Kb, not octets (bytes) so I offered an alternative. If steph84 wants to give the points to
you I won't stand in the way. It is easy enough to split the points if so desired.
0
 
seedyCommented:
'du -s -k .' will give the number of 1kb blocks used by all the files and subdirectories in the current directory.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now