Skip to content

Instantly share code, notes, and snippets.

@john-kurkowski
Created May 31, 2013 22:13
Show Gist options
  • Save john-kurkowski/5688325 to your computer and use it in GitHub Desktop.
Save john-kurkowski/5688325 to your computer and use it in GitHub Desktop.
Group folders by number of files recursively within
#!/bin/zsh
ls > foo.txt
ls | parallel -j 1 'ls {}/**/*.* | wc -l' > bar.txt
paste foo.txt bar.txt | sort -t "<TAB>" -k2 -n # <TAB> = Ctrl+V, Tab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment