Welcome to TechEnclave



+ Reply to Thread
Results 1 to 6 of 6
  1. Calling UNIX Gurus. Need help with a small query

    #1
    Vasishta.Sushant's Avatar
    is Online ਦਿਲ ਆਪਣਾ ਪੰਜਾਬੀ ! Vasishta.Sushant is highly Prominent Vasishta.Sushant is highly Prominent Vasishta.Sushant is highly Prominent Vasishta.Sushant is highly Prominent Vasishta.Sushant is highly Prominent
    Join Date: May 2007
    Location: Gurgaon
    Age: 27
    Posts: 1,037
    Default

    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 ?
  2. Re: Calling UNIX Gurus. Need help with a small query

    #2
    blackprince's Avatar
    is Offline Fanatic Member blackprince is somewhat of a mystery
    Join Date: May 2009
    Location: Bangalore
    Age: 28
    Posts: 182
    Default

    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..
  3. Re: Calling UNIX Gurus. Need help with a small query

    #3
    coolpcguy's Avatar
    is Offline Hyperactive Member coolpcguy is Mysterious
    Join Date: May 2009
    Location: Chennai, India
    Age: 25
    Posts: 69
    Default

    PHP Code:
    du -hac <directory
    > Find out how much space each file is occupying
  4. Re: Calling UNIX Gurus. Need help with a small query

    #4
    SunnyBoi's Avatar
    is Offline Hanabishi Recca SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious SunnyBoi is extremely Illustrious
    Join Date: Jan 2005
    Location: Singapore / Bangalore
    Age: 24
    Posts: 4,655
    Default

    ls-l and then awk? forgot exact commands
  5. Re: Calling UNIX Gurus. Need help with a small query

    #5
    whatsinaname's Avatar
    is Offline I can haz title! whatsinaname is highly Admirable whatsinaname is highly Admirable whatsinaname is highly Admirable whatsinaname is highly Admirable whatsinaname is highly Admirable whatsinaname is highly Admirable whatsinaname is highly Admirable
    Join Date: Apr 2007
    Posts: 756
    Default

    du -ch | grep total

    (that is for each directory, dunno how to do it for all directories)
  6. Re: Calling UNIX Gurus. Need help with a small query

    #6
    agn's Avatar
    agn
    is Offline Junior Member agn is Mysterious
    Join Date: Jun 2008
    Posts: 27
    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts