Skip to content

Instantly share code, notes, and snippets.

@emlai
Last active August 29, 2015 14:19
Show Gist options
  • Save emlai/0bc39eb7d7bb6b67cccd to your computer and use it in GitHub Desktop.
Save emlai/0bc39eb7d7bb6b67cccd to your computer and use it in GitHub Desktop.
Count number of lines in each file in a directory, sort output by line count
wc -l src/*.{cpp,h} | sort -r
# wc "word count" utility
# -l count lines
# src/* in directory named "src"
# *.{cpp,h} files with extension .cpp or .h
# | sort sort output of wc
# -r sort greatest first (reverse order)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment