简体   繁体   中英

Using grep/cat as a dictionary in UNIX

I need to make it so the words in my text file are checked for if they appear in a dictionary text file. I need it to output the words that do not appear in the text file.

I currently have: cat text.txt | grep -vi english.txt

text is the text file of words that need to be checked and english.txt is my dictionary. Currently, I just get back all of the words that are in my text.txt file (where I am purposely putting words that should not go through, meaning they are in the dictionary), what am I doing wrong?

(This is for hw so I have to use cat/grep)

try this line:

grep -viFf english.txt text.txt

If this didn't work for your file, you need give some example lines of your text.txt and english.txt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM