Reputation: 5353
Hey guys. Just like in the title - I'm having some problems doing it. Basically, I want to create an alias in my enviromental file that would count recursively and display the number of all sub-directories of a working directory. Could someone provide me with adequate group of shell commands? I'm using Korn shell. Thank you in advance!
Upvotes: 0
Views: 1748
Reputation: 51643
alias dircount="find . -type d 2> /dev/null | wc -l"
should work. But don't forget, that it skips directories for which you doesn't have access rights.
HTH
Upvotes: 2