Results 1 to 6 of 6

Thread: List folders and subfolders with size

  1. #1
    Join Date
    Jun 2007
    Beans
    88

    Question List folders and subfolders with size

    Hi,

    I want to list my folders and subfolders (recursive) and also show the size of the files in terminal.

    I started using this:

    Code:
    ls -h -R > /test.txt
    I got everything but not the size of the folders.

    Then I tried this:

    Code:
    du -h --max-depth=1 > test.txt
    Suppose to show me everything, but I can't see subfolders. And this command do not accept recursive.

    How can I show the size of the files and folders like the second command, but including the subfolders?
    The Ubuntu Counter Project - user number #14600

  2. #2
    Join Date
    Mar 2008
    Location
    Las Vegas
    Beans
    1,148

    Re: List folders and subfolders with size

    Code:
    du -h -c -b /SomePath
    Should do the trick.
    Debian Stable
    FluxBox
    Mark Your Thread Solved

  3. #3
    Join Date
    Jun 2007
    Beans
    88

    Post Re: List folders and subfolders with size

    Quote Originally Posted by Barriehie View Post
    Code:
    du -h -c -b /SomePath
    Should do the trick.
    This command does not list the files, only the folders.
    The Ubuntu Counter Project - user number #14600

  4. #4
    Join Date
    Mar 2008
    Location
    Las Vegas
    Beans
    1,148

    Re: List folders and subfolders with size

    See if
    Code:
    ls -Rs1h
    does it for you. (that's a numeric 1!)
    Debian Stable
    FluxBox
    Mark Your Thread Solved

  5. #5
    Join Date
    Jun 2007
    Beans
    88

    Talking [SOLVED] Re: List folders and subfolders with size

    Quote Originally Posted by Barriehie View Post
    See if
    Code:
    ls -Rs1h
    does it for you. (that's a numeric 1!)
    Yes it does. No the way I wanted, buy it does. Thanks
    The Ubuntu Counter Project - user number #14600

  6. #6
    Join Date
    Mar 2008
    Location
    Las Vegas
    Beans
    1,148

    Re: [SOLVED] Re: List folders and subfolders with size

    Quote Originally Posted by DouglasCaixeta View Post
    Yes it does. No the way I wanted, buy it does. Thanks

    To really slice/dice/mutilate/process the listing you might want to check out gawk, probably already installed on your system and it's not to terribly complicated.
    Debian Stable
    FluxBox
    Mark Your Thread Solved

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
  •