Results 1 to 6 of 6
  1. #1
    Vasishta.Sushant is offline Privileged Users
    Join Date
    May 2007
    Posts
    1,141
    Lemme try to put is as simply as I can.



    I have a directory named TEMP. Within that there are directories Temp1, Temp2, Temp3 and so on.



    Now all these sub directories are created either by User1, User2 or User3 (or may be more).



    How do I calculate the space used by each user (or should I say the sub directories created by the users) ?



    I tried using the du but I am not finding a way to do that for individual users.



    My primary motive is to find the space occupied by each individual user.



    Pointer ?
    Canon 550D | 18-55mm IS | 50mm 1.8f | 55-250mm IS | Benro A550BH1 | Lowepro TLZ 45AW | Lowepro Pro Runner AW200

  2. #2
    blackprince is offline Privileged Users
    Join Date
    May 2009
    Posts
    205
    one doubt..



    are the user dirs one level or multi level

    ie do u have dirs inside temp1..



    if its single level then its simple...



    if not ..you have a task in hand..
    Intel C2D 7400 || Biostar : Tpower I45 || 2x2GB Corsair Dominator||Corsair 450 VX || WD Caviar Black 1 TB SATA ( WD1001FALS ) ||1 TB Segate 7200.12|| Sapphire HD 4770||Samsung 2033W

  3. #3
    coolpcguy is offline Upgraded User
    Join Date
    May 2009
    Location
    Bangalore
    Posts
    71

  4. #4
    SunnyBoi is offline Upgraded User
    Join Date
    Jan 2005
    Location
    Bangalore
    Posts
    4,456
    ls-l and then awk? forgot exact commands

  5. #5
    whatsinaname is offline Privileged Users
    Join Date
    Apr 2007
    Posts
    1,030
    du -ch | grep total



    (that is for each directory, dunno how to do it for all directories)

  6. #6
    agn
    agn is offline Upgraded User
    Join Date
    Jun 2008
    Posts
    36
    Try something like

    Code:
    $ for u in user1 user2 user3; do find TEMP -user $u -print0 | xargs -0 du -ch; done

 

 

Similar Threads

  1. Replies: 10
    Last Post: 26-09-10, 10:55 PM
  2. Calling all Unix Gurus: Shell Scripting Query
    By Vasishta.Sushant in forum Programming
    Replies: 3
    Last Post: 11-08-10, 06:29 PM
  3. Replies: 20
    Last Post: 20-01-10, 08:50 AM
  4. Calling all VB 6 Gurus
    By Himanshunegi198 in forum Programming
    Replies: 3
    Last Post: 28-10-09, 10:46 PM
  5. Calling all CONFIG Gurus !!!
    By TheDevil in forum PC Peripherals
    Replies: 40
    Last Post: 29-04-07, 12:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +5.5. The time now is 12:40 PM. Powered by vBulletin® Version 4.1.12
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.0 PL2