Linux provides all sorts of tools for data analysis and automation, but it also helps with an issue that we all struggle with from time to time \u2013 spelling! Whether you're grappling with the spelling of a single word while you\u2019re writing your weekly report or you want a set of computerized "eyes" to find your typos before you submit a business proposal, maybe it\u2019s time to check out how it can help.\nlook\nOne tool is look. If you know how a word begins, you can ask the look command for provide a list of words that start with those letters. Unless an alternate word source is provided, look uses \/usr\/share\/dict\/words to identify the words for you. This file with its hundreds of thousands of words will suffice for most of the English words that we routinely use, but it might not have some of the more obscure words that some of us in the computing field tend to use \u2014 such as zettabyte.\n\nThe look command's syntax is as easy as can be. Type "look word" and it will run through all the words in that words file and find matches for you.\n$ look amelio\nameliorable\nameliorableness\nameliorant\nameliorate\nameliorated\nameliorates\nameliorating\namelioration\nameliorations\nameliorativ\nameliorative\namelioratively\nameliorator\namelioratory\n\nIf you happen upon a word that isn't included in the word list on the system, you'll simply get no output.\n$ look zetta\n$\n\nDon\u2019t despair if you're not seeing what you were hoping for. You can add words to your words file or even reference an altogether different words list \u2014 either finding one online and creating one yourself. You don't even have to place an added word in the proper alphabetical location; just add it to the end of the file. You do need to do this as root, however. For example (and be careful with that >>!):\n# echo \u201czettabyte\u201d >> \/usr\/share\/dict\/words\n\nUsing a different list of words ("jargon" in this case) just requires adding the name of the file. Use a full path if the file is not the default.\n$ look nybble \/usr\/share\/dict\/jargon\nnybble\nnybbles\n\nThe look command is also case-insensitive, so you don't have to concern yourself with whether the word you're looking for should be capitalized or not.\n$ look zet\nZETA\nZeta\nzeta\nzetacism\nZetana\nzetas\nZetes\nzetetic\nZethar\nZethus\nZetland\nZetta\n\nOf course, not all word lists are created equal. Some Linux distributions provide a lot more words than others in their word files. Yours might have 100,000 words or many times that number.\nOn one of my Linux systems:\n$ wc -l \/usr\/share\/dict\/words\n102402 \/usr\/share\/dict\/words\n\nOn another:\n$ wc -l \/usr\/share\/dict\/words\n479828 \/usr\/share\/dict\/words\n\nRemember that the look command works only with the beginnings of words, but there are other options if you don't want to start there.\ngrep\nOur dearly beloved grep command can pluck words from a word file as well as any tool. If you\u2019re looking for words that start or end with particular letters, grep is a natural. It can match words using beginnings, endings, or middle portions of words. Your system's word file will work with grep as easily as it does with look. The only drawback is that unlike with look, you have to specify the file.\nUsing word beginnings with ^:\n$ grep ^terra \/usr\/share\/dict\/words\nterrace\nterrace's\nterraced\nterraces\nterracing\nterrain\nterrain's\nterrains\nterrapin\nterrapin's\nterrapins\nterraria\nterrarium\nterrarium's\nterrariums\n\nUsing word endings with $:\n$ grep bytes$ \/usr\/share\/dict\/words\nbytes\ngigabytes\nkilobytes\nmegabytes\nterabytes\n\nWith grep, you do need to concern yourself with capitalization, but the command provides some options for that.\n$ grep ^[Zz]et \/usr\/share\/dict\/words\nZeta\nzeta\nzetacism\nZetana\nzetas\nZetes\nzetetic\nZethar\nZethus\nZetland\nZetta\nzettabyte\n\nSetting up a symbolic link to the words file makes this kind of word search a little easier:\n$ ln -s \/usr\/share\/dict\/words words\n$ grep ^[Zz]et words\nZeta\nzeta\nzetacism\nZetana\nzetas\nZetes\nzetetic\nZethar\nZethus\nZetland\nZetta\nzettabytye\n\naspell\nThe aspell command takes a different approach. It provides a way to check the spelling in whatever file or text you provide to it. You can pipe text to it and have it tell you which words appear to be misspelled. If you\u2019re spelling all the words correctly, you\u2019ll see no output.\n$ echo Did I mispell that? | aspell list\nmispell\n$ echo I can hardly wait to try out aspell | aspell list\naspell \n$ echo Did I misspell anything? | aspell list\n$\n\nThe "list" argument tells aspell to provide a list of misspelled words in the words that are sent through standard input.\nYou can also use aspell to locate and correct words in a text file. If it finds a misspelled word, it will offer you an opportunity to replace it from a list of similar (but correctly spelled) words, to accept the words and add them to your personal words list (~\/.aspell.en.pws), to ignore the misspelling, or to abort the process altogether (leaving the file as it was before you started).\n$ aspell -c mytext\n\nOnce aspell finds a word that\u2019s misspelled, it offers a list of choices like these for the incorrect "mispell":\n1) mi spell 6) misplay\n2) mi-spell 7) spell\n3) misspell 8) misapply\n4) Ispell 9) Aspell\n5) misspells 0) dispel\ni) Ignore I) Ignore all\nr) Replace R) Replace all\na) Add l) Add Lower\nb) Abort x) Exit\n\nNote that the alternate words and spellings are numbered, while other options are represented by letter choices. You can choose one of the suggested spellings or opt to type a replacement. The "Abort" choice will leave the file intact even if you've already chosen replacements for some words. Words you elect to add will be inserted into a local file (e.g., ~\/.aspell.en.pws).\nAlternate word lists\nTired of English? The aspell command can work with other languages if you add a word file for them. To add a dictionary for French on Debian systems, for example, you could do this:\n$ sudo apt install aspell-fr\n\nThis new dictionary file would be installed as \/usr\/share\/dict\/French. To use it, you would simply need to tell aspell that you want to use the alternate word list:\n$ aspell --lang=fr -c mytext\n\nWhen using, you might see something like this if aspell looks at the word \u201cone\u201d:\n1) once 6) orn\u00e9\n2) onde 7) ne\n3) ond\u00e9 8) n\u00e9\n4) onze 9) on\n5) orne 0) c\u00f4ne\ni) Ignore I) Ignore all\nr) Replace R) Replace all\na) Add l) Add Lower\nb) Abort x) Exit\n\nYou can also get other language word lists from GNU.\nWrap-up\nEven if you're a national spelling bee winner, you probably need a little help with spelling every now and then \u2014 if only to spot your typos. The aspell tool, along with look and grep, are ready to come to your rescue.