How to use the Linux ispell command

Source: Internet
Author: User

Ispell uses the/usr/lib/ispell/english. hash dictionary file to check text files. If no dictionary words are found in the checked files, ispell will recommend the words or ask you to add new words to the personal dictionary.

Syntax

Ispell [-aAbBClmMnNPStVx] [-d <Dictionary File>] [-L <number of rows>] [-p <Dictionary File>]

[-W <non-letter characters>] [-W <string length>] [file to be checked]

Parameters:

  • -A this parameter is required when other program outputs are sent to ispell.
  • -When A reads the "& Include File &" string, it checks the content of the specified File after the string.
  • -B generates a backup file named. bak.
  • -B: Check for incorrect connection.
  • -C does not check for a hyphen error.
  • -D <Dictionary File> specifies the dictionary file.
  • -L reads the string from the standard input device, and then displays the spelling error words.
  • -L <number of rows> specifies the number of lines displayed in the internal text.
  • -M automatically considers the changes at the end of the word.
  • -M: after entering ispell, the command button is displayed below the screen.
  • -N check files are in noff or troff format.
  • -N after entering ispell, the command button is not displayed below the screen.
  • -P <Dictionary File> specifies the personal dictionary file.
  • -P does not consider changing the end of a word.
  • -S: do not sort words that are recommended to be replaced.
  • -T check files are in TeX or LaTeX format.
  • Non-ANSI characters of-V are displayed as "M-^.
  • -W <non-letter character> Check, special pick contains the specified character.
  • -W <string length> does not check the words of the specified length.
  • -X does not generate backup files.

Instance

Check the spelling of the file. For example, to check the testfile, run the following command:

Ispell testfile

If a suspicious word appears in the file, the first suspicious word is highlighted, and the comments for modifying the word and the ispell operation command are displayed at the bottom of the screen. As follows:

Netwrks File: testfile

Linux netwrks are becoming more and more common, but security is often an overlooked issue. Unfortunately

0: networks

[SP] <number> R) epl A) ccept I) nsert L) ookup U) ncap Q) uit e (X) it or? For help

In this example, check the netwrks error and prompt to correct the information. Enter "0", that is, use networks to correct the error, and continue to display the next error until all the errors are displayed.

Through the above example, we can find that the file testfile has a spelling error. After modifying the file, we need to back up the file. Run the following command:

Ispell-B testfile # back up the file while checking spelling errors

If the file has no spelling errors, no information is displayed. By using the ls command, we can also see that the backup file testfile. bak of the file is generated in the current file directory. The result is as follows:

$ Ls # View files in the current directory in the form of a list

Examples. desktop testfile_1 testfile. bak xx01 template image Music

Testfile testfile1 testfile_2 xx00 public video document desktop

Among them, the testfile. bak file is the backup file generated by the command just now. The content is the same as that of the original testfile file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.