If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > disk space used for a few files in few directories

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-05, 17:10
kasala kasala is offline
Registered User
 
Join Date: Jan 2005
Posts: 1
disk space used for a few files in few directories

Hello,
I am new to shell scripting and have a k shell. I need to develop a script wherein it should give an output of the total disk space used for certain no. of files within certain directories.
The main directory is fileserver01, under which I have different directories with names say.. dir1, dir2,dir3,dir4,dir5. under each of these, there are different files. My question is... I need to get the amont of space used for the files(excluding files starting with del.*) in each of dir1,dir2 and dir3.


Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-14-05, 11:41
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,454
You could use find with "-ls" option to list file sizes and then awk to sum them up.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On