Created
June 11, 2018 21:58
-
-
Save brightredchilli/257cc71861b30172a117fbd9130183b2 to your computer and use it in GitHub Desktop.
Count lines in files matching a certain criteria
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"grep all filenames containing Interactor.swift, quote the output so that we can pass to xargs | |
"then sort by line count, then use awk again to remove some unnecessary columns | |
find Code | grep Interactor.swift | awk '{printf("\"%s\"\n", $0);}' | xargs wc | sort --reverse -k 1 | awk '{$2=$3=""}1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"grep all filenames containing Interactor.swift, quote the output so that we can pass to xargs
"then sort by line count, then use awk again to remove some unnecessary columns
find Code | grep Interactor.swift | awk '{printf(""%s"\n", $0);}' | xargs wc | sort --reverse -k 1 | awk '{$2=$3=""}1'