Solved

total amount of octets used in a directory

Posted on 1998-06-11
7
314 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
  • 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now