Latest web development tutorials

Linux ispell command

Linux command Daquan Linux command Daquan

Linux ispell command spell checker.

We will use the default ispell dictionary file /usr/lib/ispell/english.hash to check the text file. If you find no words in the dictionary to check the file, ispell will recommend the use of vocabulary, or you will make new words to your personal dictionary.

grammar

ispell [-aAbBClmMnNPStVx][-d<字典文件>][-L<行数>][-p<字典文件>][-w<非字母字符>][-W<字符串长度>][要检查的文件]

Parameters:

  • When another program -a output to ispell, you must use this parameter.
  • When -A read "& Include File &" string, went to check the contents of the string after the specified file.
  • -b backup file, the file is named .bak.
  • -B Check hyphenation errors.
  • -C Does not check hyphenation errors.
  • -d <dictionary file> specify the dictionary file.
  • -l string read from the standard input device, misspelled words after the show.
  • -L Number Line <line number> Specifies the text to display.
  • -m automatically take into account changes in the suffix.
  • After -M enter ispell, at the bottom of the screen display instruction button.
  • -n check noff or troff file format.
  • After -N enter ispell, command buttons are not displayed in the bottom of the screen.
  • -p <dictionary file> Specifies the personal dictionary file.
  • -P Suffix does not consider the situation changes.
  • -S Is not the sort proposed to replace the word.
  • -t checking documents to TeX or LaTeX format.
  • -V Non-ANSI standard characters will be "M- ^" way to display.
  • -w <non-alphanumeric characters> inspection, particularly singled out containing the specified character.
  • -W <String length> specified does not check the length of the word.
  • -x Do not generate backup file.

Examples

Spell checking documents. For example, check testfile file, use the following command:

ispell testfile 

If the word appears suspicious file, the first word that appears suspicious to highlight and give words at the bottom of the screen, and amendments ispell operation command. 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 case, check out netwrks errors, and prompt correction information, then enter "0", that is, the use of networks to correct the error, but continues to display the next error, until the completion of all errors display.

Through the above examples we can see that the file testfile misspelling, after modifying the file to be backed up file. This time using the following command:

ispell-b testfile    #检查拼写错误的同时,备份文件 

If the file has no spelling mistakes, do not display any information, resulting in a file testfile backup files testfile.bak by the ls command, we can also view the current directory. See results are as follows:

$ ls #以列表的形式查看当前目录下的文件  
examples.desktop testfile_1 testfile.bak xx01 模板图片 音乐  
testfile testfile1 testfile_2 xx00 公共的视频文档桌面 

Wherein, testfile.bak document is just a backup file generated by the command, and the contents of the original contents of the file testfile is the same.

Linux command Daquan Linux command Daquan