Last active
March 29, 2019 11:10
-
-
Save gargolito/6926dcb73fea5bee9e73346749406350 to your computer and use it in GitHub Desktop.
#bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compare two directories | |
diff --brief --recursive --no-dereference --new-file --no-ignore-file-name-case /dir1 /dir2 > dirdiff_1.txt | |
rsync --recursive --delete --links --checksum --verbose --dry-run /dir1/ /dir2/ > dirdiff_2.txt | |
# Given a text file and an integer k, print the k most common words in the file (and the number of their occurrences) in decreasing frequency. https://www.johndcook.com/blog/2019/02/18/command-line-wizard/ | |
cat stuff.txt | tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | sort -rn | sed ${1}q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment