Skip to content

Instantly share code, notes, and snippets.

@Danilo-Araujo-Silva
Last active February 16, 2024 15:20
Show Gist options
  • Save Danilo-Araujo-Silva/c5c04e138c3d854aa66e0c6033fb1570 to your computer and use it in GitHub Desktop.
Save Danilo-Araujo-Silva/c5c04e138c3d854aa66e0c6033fb1570 to your computer and use it in GitHub Desktop.
tree command, only folders, human readable format, easy way to find large folders
# Command:
sudo tree --du -ahF /path/to/folder | grep "\(files\|/\)$"
# Example from a fresh google colab opt folder:
# Command: !sudo tree --du -ahF /opt | grep "\(files\|/\)$"
# Output:
├── [ 45M] google/
│ └── [ 45M] drive/
└── [1.8G] nvidia/
├── [650M] nsight-compute/
│ └── [650M] 2021.1.0/
│ ├── [ 16M] docs/
│ │ ├── [411K] common/
│ │ │ ├── [395K] formatting/
│ │ │ │ ├── [183K] prettify/
│ │ │ └── [ 13K] scripts/
│ │ │ ├── [4.3K] google-analytics/
│ │ │ └── [4.3K] tynt/
│ │ ├── [ 93K] CopyrightAndLicenses/
│ │ ├── [369K] CustomizationGuide/
│ │ │ ├── [300K] graphics/
│ │ ├── [1.5M] NsightCompute/
│ │ │ ├── [1.3M] graphics/
│ │ ├── [288K] NsightComputeCli/
│ │ ├── [303K] NvRulesAPI/
│ │ ├── [ 12M] pdf/
│ │ ├── [695K] ProfilingGuide/
│ │ │ ├── [444K] graphics/
│ │ ├── [109K] ReleaseNotes/
│ │ ├── [141K] search/
│ │ │ └── [7.4K] stemmers/
│ │ └── [ 15K] Training/
│ ├── [ 60K] extras/
│ │ ├── [ 43K] FileFormat/
│ │ └── [ 13K] RuleTemplates/
│ ├── [262M] host/
│ │ └── [262M] linux-desktop-glibc_2_11_3-x64/
│ │ ├── [ 14K] libexec/
│ │ ├── [126M] Plugins/
│ │ │ ├── [700K] CorePlugin/
│ │ │ ├── [964K] imageformats/
│ │ │ ├── [ 14K] platforms/
│ │ │ ├── [ 54M] RebelPlugin/
│ │ │ ├── [ 45M] SassDebuggerPlugin/
│ │ │ └── [ 72K] xcbglintegrations/
│ │ ├── [ 23M] resources/
│ │ └── [ 15M] translations/
│ │ └── [ 15M] qtwebengine_locales/
│ ├── [124K] sections/
│ └── [372M] target/
│ ├── [129M] linux-desktop-glibc_2_11_3-x64/
│ ├── [4.8M] linux-desktop-glibc_2_11_3-x86/
│ ├── [125M] linux-desktop-glibc_2_19_0-ppc64le/
│ └── [113M] linux-desktop-t210-a64/
└── [1.2G] nsight-systems/
├── [591M] 2020.3.2/
│ ├── [4.1K] bin/
│ ├── [3.0M] documentation/
│ │ └── [3.0M] nsys-exporter/
│ │ └── [2.7M] _static/
│ ├── [347M] host-linux-x64/
│ │ ├── [ 14K] libexec/
│ │ ├── [ 21M] Mesa/
│ │ ├── [7.8M] Plugins/
│ │ │ ├── [542K] CorePlugin/
│ │ │ ├── [1.1M] imageformats/
│ │ │ ├── [268K] platforms/
│ │ │ ├── [5.9M] QuadDPlugin/
│ │ │ └── [103K] xcbglintegrations/
│ │ ├── [ 23M] resources/
│ │ └── [ 15M] translations/
│ │ └── [ 15M] qtwebengine_locales/
│ ├── [144M] target-linux-armv8/
│ │ ├── [ 51M] host-linux-armv8/
│ │ ├── [235K] nvtx/
│ │ │ └── [231K] include/
│ │ │ └── [227K] nvtx3/
│ │ │ └── [138K] nvtxDetail/
│ │ ├── [ 63K] reports/
│ └── [ 97M] target-linux-x64/
│ ├── [ 31K] NvTraceFormat/
│ ├── [235K] nvtx/
│ │ └── [231K] include/
│ │ └── [227K] nvtx3/
│ │ └── [138K] nvtxDetail/
│ ├── [ 63K] reports/
│ └── [6.7K] vulkan-layers/
└── [647M] 2021.1.3/
├── [4.0K] bin/
├── [3.2M] documentation/
│ └── [3.2M] nsys-exporter/
│ └── [2.9M] _static/
├── [367M] host-linux-x64/
│ ├── [ 14K] libexec/
│ ├── [ 21M] Mesa/
│ ├── [9.0M] Plugins/
│ │ ├── [551K] CorePlugin/
│ │ ├── [1.1M] imageformats/
│ │ ├── [268K] platforms/
│ │ ├── [7.1M] QuadDPlugin/
│ │ └── [103K] xcbglintegrations/
│ ├── [ 10M] python/
│ │ ├── [ 10M] bin/
│ │ └── [ 11K] lib/
│ ├── [ 23M] resources/
│ ├── [ 16K] rules/
│ └── [ 15M] translations/
│ └── [ 15M] qtwebengine_locales/
├── [158M] target-linux-armv8/
│ ├── [ 54M] host-linux-armv8/
│ ├── [235K] nvtx/
│ │ └── [231K] include/
│ │ └── [227K] nvtx3/
│ │ └── [138K] nvtxDetail/
│ ├── [9.7M] python/
│ │ ├── [9.7M] bin/
│ │ └── [ 11K] lib/
│ ├── [ 42K] reports/
│ ├── [ 16K] rules/
└── [119M] target-linux-x64/
├── [ 31K] NvTraceFormat/
├── [235K] nvtx/
│ └── [231K] include/
│ └── [227K] nvtx3/
│ └── [138K] nvtxDetail/
├── [ 10M] python/
│ ├── [ 10M] bin/
│ └── [ 11K] lib/
├── [ 42K] reports/
├── [ 16K] rules/
└── [7.1K] vulkan-layers/
1.9G used in 125 directories, 1300 files
@SomnathYadu
Copy link

thanks, just the command I was searching for.

@Danilo-Araujo-Silva
Copy link
Author

thanks, just the command I was searching for.

Oh, many thanks, I'm glad that it was helpful for you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment