English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Comprehensive List of Linux Commands
The Linux ispell command is used for the spelling checking program.
ispell defaults to using/usr/lib/ispell/The english.hash dictionary file is used to check text files. If a word not in the dictionary is found in the checked file, ispell will suggest a word to use or allow you to add a new word to the personal dictionary.
ispell [-aAbBClmMnNPStVx][-d<dictionary file>][-L<line number>][-p<dictionary file>][-w<non-letter character>][-W<word length>][To check the file]
Parameters:
-a When other program output is sent to ispell, this parameter must be used.
-A When reading the string "&Include File&", check the content of the file specified after the string.
-b Generate backup files with the name .bak.
-B Check hyphenation errors.
-C Do not check hyphenation errors.
-d<dictionary file> Specify the dictionary file.
-l Read strings from the standard input device, and display misspelled words at the end.
-L<line number> Specify the number of lines displayed in the text.
-m Automatically consider word ending variations.
-M After entering ispell, display the instruction keys at the bottom of the screen.
-n The file being checked is in noff or troff format.
-N After entering ispell, do not display the instruction keys at the bottom of the screen.
-p<dictionary file> Specify a personal dictionary file.
-P Do not consider the word ending variation.
-S Do not sort the suggested replacement words.
-t The file being checked is in TeX or LaTeX format.
-V Non-ANSI standard characters will be displayed as 'M'.-Displayed by '^".
-w<non-letter character> Especially pick out words containing the specified character when checking.
-W<word length> Do not check words of the specified length.
-x Do not generate backup files.
Check the spelling of the file. For example, to check the testfile file, you can use the following command:
ispell testfile
If suspicious words appear in the file, the first suspicious word appears in highlight, and the screen below gives suggestions for modifying the word, as well as the ispell operation command. As shown below:
netwrks File: testfile Linux networks are becoming more and more common, but security is often an overlooked issue 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, the error netwrks is found, and the correction information is prompted. At this time, enter "0", which means using networks to correct the error, and continue to display the next error until all errors are displayed.
From the above examples, we can find that there are spelling errors in the file testfile, and a backup file is required after modifying the file. At this time, use the following command:
ispell-b testfile # Check for spelling errors while backing up the file
If there are no spelling errors in the file, no information is displayed. By using the ls command, we can also see that the backup file testfile.bak has been generated under the current file directory. The viewing result is as follows:
$ ls # View the files in the current directory in list form 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, and its content is the same as that of the original testfile file.