alias for unique lines of code

This commit is contained in:
Morgan Wattiez 2019-09-13 15:42:35 +02:00
parent c1295c2208
commit f9b88bed52

View File

@ -102,6 +102,19 @@ function skip {
cut -d' ' -f$n-
}
# Unique lines of code
# Via https://text.causal.agency/004-uloc.txt
function uloc {
find . -type f \( \
-name '*.py' \
-o -name '*.rb' \
-o -name '*.go' \
-o -name '*.java' \
-o -name '*.c' -o -name '*.h' \
-o -name '*.js' \
\) -exec cat \{\} \; | sort -u | wc -l
}
# Find files bigger than X size and sort them by size
function biggerthan() {
find . -size "+$*" -type f -print0 | xargs -0 ls -Ssh | sort -z