Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Awker Expert, Help Pls!!!

Status
Not open for further replies.

hendnov

Technical User
Feb 27, 2006
73
AU
Hi guys,

I've been strugling doing this using awk scripting, here's I have parent directory and certain number of subdirectories, and I want to see the disk usage of SGML directory which is in each subdirectory, and the problem is we don't know which level further down from subdirectory, but what I'm sure is each subdirectory has one SGML directory and I want to sum all disk usage SGML directory in parent directory. How do I do that?

THX GUYS,
 
yeah, but how do I program it in awk and how if i want to ignore case? and last one, after I program it in awk, how do I make that awk file is executable or I can call it from any directory, because I already put my awkfile in bin directory but I have to call from that directory.

THX
 
Finding the directories and their sizes should be easy outside of "awk". Maybe one of the awk experts can help with the sumation work?

This will create a temp file with sub-directories named SGML (case insensitive):

Code:
BASEDIR=/wherever/you/choose
cd $BASEDIR
find . -type d -print |grep -i sgml |xargs du -ks >sgml.sums
[code]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top