Header Ads

Breaking News

How to take advantage of Linux's extensive vocabulary


While you might not think of Linux as a writing tutor, it does have some commendable language skills – at least when it comes to English. While the average American probably has a vocabulary between 20,000 and 50,000 words, Linux can claim over 100,000 words (spellings, not definitions). And you can easily put this vocabulary to work for you in a number of ways. Let’s look at how Linux can help with your word challenges.

Help with finding words

First, let’s focus on finding words.If you use the wc command to count the number of words in the /usr/share/dict/words file on your system, you should see something like this:

$ wc -l /usr/share/dict/words
102402 /usr/share/dict/words

As you can see, the words file on this system contains 102,402 words. So, when you’re trying to nail down just the right word and are having trouble, you stand a good chance of finding it on your system by remembering (or guessing at) some part of it. But you’ll need a little help narrowing down those 102,402 words to a group worth your time to review. In this command, we’re looking for words that start with the letters “revi”.

$ grep ^reviv /usr/share/dict/words
revival
revival's
revivalist
revivalist's
revivalists
revivals
revive
revived
revives
revivification
revivification's
revivified
revivifies
revivify
revivifying
reviving

That’s sixteen words that start with the string “revi”. The ^ character represents the beginning of the word and, as you might have suspected, each word in the file is on a line by itself.

A good number of the words in the /usr/share/dict/words file are names. If you want to  find words regardless of whether they’re capitalized, add the -i (ignore case) option to your grep command.

$ grep -i ^wool /usr/share/dict/words
Woolf
Woolf's
Woolite
Woolite's
Woolongong
Woolongong's
Woolworth
Woolworth's
wool
...

You can also look for words that end in or contain a certain string of letters. In this next command, we look for words that contain the string “nativ” at any location.

Copyright © 2020 IDG Communications, Inc.

Source Link

No comments