Skip to content

Instantly share code, notes, and snippets.

@digimix
Created March 20, 2018 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digimix/8c59e75fadab20de2c795c718bbc6208 to your computer and use it in GitHub Desktop.
Save digimix/8c59e75fadab20de2c795c718bbc6208 to your computer and use it in GitHub Desktop.
Terminal command to extract hashtags from text using pbpaste. Counts hashtags, puts them in alphabetical order, and removes duplicates.

$: pbpaste | grep '#\w\+' -o | tr 'A-Z' 'a-z' | sort | uniq -c | pbcopy

Terminal command: paste, find all hashtags, convert to lowercase, sort in alphabetical order, only show uniques and also show the count how many times it was found in the list, copy the results

Works with Mac OSX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment