Thursday, July 9, 2015

find'ing Directories in cwd w/out a partial name fragment recursively below

The following alias will find all directories in the current working directory that do not have the passed in argument in any portion of the path.
alias lsdv='_() { find . -type d | grep -v -F -f <(find  . -type d | grep -i "${1}" 
| awk -F"/" "{print \$2}" | uniq) | grep -Ev "^\.{1,2}\$"; }; _' 
Note: lsdv - ls (listing) d (directory) v (like grep -v). This also filters the current directory.

No comments:

Post a Comment