Skip to content

Instantly share code, notes, and snippets.

@walm
Created February 16, 2015 08:43
Show Gist options
  • Save walm/9d919c427b72ee1f22aa to your computer and use it in GitHub Desktop.
Save walm/9d919c427b72ee1f22aa to your computer and use it in GitHub Desktop.
List all uniq folder names in tree
find . -type d -printf "%f\n" | sort -f | uniq -i
@walm
Copy link
Author

walm commented Feb 16, 2015

.. don't work in OSX as find don't have the -printf option.

@walm
Copy link
Author

walm commented Feb 16, 2015

in bash you can also get folder basename with

echo "${PWD##*/}"

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