Skip to content

Instantly share code, notes, and snippets.

@brightredchilli
Created June 11, 2018 21:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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

"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