Find the answer to your Linux question:
Results 1 to 3 of 3
I need a command to list the total sizes for all the directories in a mounted drive. I tried df and du. df list the total size for the mounted ...
  1. #1
    Linux Newbie Mad Professor's Avatar
    Join Date
    May 2006
    Posts
    128

    command to list directories and sizes.

    I need a command to list the total sizes for all the directories in a mounted drive.

    I tried df and du.
    df list the total size for the mounted drive

    du depending on what option I give it either list the total size or list all the sizes for every file on the drive.

    All I want to know is the sizes of all the directories on the mounted drive.

    This is a windows vista hard-drive and for some reason ubuntu is reporting a 50 GB partition and only 10GB free, I want to know what's taking up all the free space. I can't find anything in the file browser, so far I've only managed to count up about 10GB of used space so where is the other 30GB.

  2. #2
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    140
    Maybe you're looking for ls?
    Sorry, I have to go out or I'd go through the manual, you could do it yourself
    [you@Ypurbox~]$ man ls

  3. #3
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    du by default should only list directories, recursively from the starting directory.

    The following works for me:
    Code:
    du -h /path/to/directory | sort -rh | less
    So if your windows partition was on /media/windows it would be
    Code:
    du -h /media/windows | sort -rh | less
    Also very handy is ncdu.

Posting Permissions

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