Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Count lines in files matching a certain criteria
"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'
@cecibelrojas
Copy link

cecibelrojas commented Jun 11, 2018

"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