Open In App

aspell command in Linux with examples

Last Updated : 04 Apr, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

aspell command is used as a spell checker in Linux. Generally, it will scan the given files or anything from standard input then it check for misspellings. Finally it allows the user to correct the words interactively.

Syntax:

aspell check [options] filename

Options:

  • -a : To check individual words.
  • -c : Check a file for specific error.
  • -mode=mode : The modes we have to use when checking files.
  • -master=name : It is the main dictionary to use.
  • -dont-backup : It doesn’t create a backup file.
  • -encoding=name :Encoding the file is expected to be in.
  • -lang=name -l name : It describes the language the document is written in. By default it depends on the current locale.
  • -sug-mode=mode : The Suggestion Mode.

Example 1: Check a file for spelling errors

aspell -c sample.txt

Sample Text

Example 2: Using aspell to check individual words.

aspell -a

Note: As soon as you run this command, it will wait for user input. Type a word in this mode, press enter, and you’ll see aspell offering spelling suggestions on stdout.

Example 3: Using aspell to check words in bulk. When run, will wait for user input. Add as many words as you want, and when done, press Ctrl+D. Then you’ll see that aspell will display incorrectly spelled words below the input you provided.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads