wc -l .gitconfigThis would output something like the following:
11 .gitconfigOr count the number of characters with -c:
wc -c .gitconfigOr check the number of words:
wc -w .gitconfigYou can also run it against multiple files. For example, here I’ll check the number of lines in both my .gitconfig file and my .gitignore_global files:
wc -l .gitconfig .gitignore_globalLet’s say I have a list of numbers and I want to take an average of them. I can use this to quickly figure out how many numbers I have (and so will divide by) before tallying them up.
krypted July 4th, 2015