[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

total amount of octets used in a directory

Posted on 1998-06-11
7
Medium Priority
?
355 Views
Last Modified: 2010-05-18
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
Comment
Question by:steph84
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 2

Expert Comment

by:seedy
ID: 2007866
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
 
LVL 2

Expert Comment

by:seedy
ID: 2007867
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
 

Author Comment

by:steph84
ID: 2007868
perfect you should answer that i grade you!
0
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.

 
LVL 3

Expert Comment

by:braveheart
ID: 2007869
"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
 
LVL 2

Expert Comment

by:seedy
ID: 2007870
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
 
LVL 3

Expert Comment

by:braveheart
ID: 2007871
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
 
LVL 2

Accepted Solution

by:
seedy earned 200 total points
ID: 2007872
'du -s -k .' will give the number of 1kb blocks used by all the files and subdirectories in the current directory.

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question