Quantcast
Viewing all articles
Browse latest Browse all 663

Answer by Kamil Maciorowski for How to sort folders by a specific subfolder's size?

This is an example that uses tools available in Ubuntu, but the idea is general and can be implemented with other tools. Even in Ubuntu you may want to adjust the solution to your needs.

  1. Place yourself in the parent directory of the directory you want to analyze. In your case the directory you want to analyze is GameID and the parent directory is SteamWorkshop.

  2. Make a copy of the whole directory you want to analyze. Use hardlinks or reflinks (if possible).

    cp -rlx --no-preserve=all GameID GameID_copy
  3. In the copy remove everything you don't want to count:

    find GameID_copy ! -type d ! -path '*/sounds/*' -delete

    The above command deliberately leaves all directories intact, so in the next step you will be able to see the whole directory structure.

  4. Analyze what is left:

    ncdu GameID_copy
  5. Remove the copy when done:

    rm -r GameID_copy

Viewing all articles
Browse latest Browse all 663

Trending Articles