Skip to content

Instantly share code, notes, and snippets.

@danchristal
danchristal / Unix Commands
Created September 5, 2016 21:03
Unix Commands
Write a command that will output the number of times the cat command was used previously
history | grep -c "cat"
Write a command to output a count of all words in the unix dictionary file that begin with the letter "a"
cat /usr/share/dict/words | grep -c "^a"
Return all the words in the dictionary that start with "a" and end with "s"
cat /usr/share/dict/words | grep -E '^a' | grep -E 's$' -c