Skip to content

Commit

Permalink
doc: add more shell examples to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
zeke committed Sep 23, 2017
1 parent c9f1cc6 commit 00da20c
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,45 @@ There's a CLI that prints all words to STDOUT. Install it globally:

```sh
npm i -g an-array-of-english-words
```

Run `words` to print all the words to stdout:

```sh
words
```

Use `grep` to filter by pattern:

```
words | grep cheese
```

Use `egrep` to filter with regular expressions:

```sh
words | egrep '^fun' # start with 'fun'
words | egrep 'ification$' # end with 'ification'
words | egrep 'ou?r$' # end in 'or' or 'our'
```

Use `wc` to find out how many `monkey` words there are:

```sh
words | grep monkey | wc -l
```

Ten random ten-letter words:

```sh
$ words | egrep '^.{10}$' | gshuf | head -10
```

Note: On macOS, `brew install coreutils` to get
[`gshuf`](https://en.wikipedia.org/wiki/Shuf) and other goodies.

## See Also

- [similar-english-words](http://ghub.io/similar-english-words)
- [an-array-of-spanish-words](https://github.com/zeke/an-array-of-spanish-words)
- [an-array-of-french-words](https://github.com/zeke/an-array-of-french-words)
- [similar-english-words](https://github.com/words/similar-english-words)
- [an-array-of-spanish-words](https://github.com/words/an-array-of-spanish-words)
- [an-array-of-french-words](https://github.com/words/an-array-of-french-words)

0 comments on commit 00da20c

Please sign in to comment.