我必须找出在一个文件中使用 shell 这个词的次数。我用grep "shell" test.txt | wc -w是为了统计这个词被使用了多少次,结果是4而不是3。文件内容是:
grep "shell" test.txt | wc -w
this is a test file for shell_A shell_B sh shel and shell_C script project
grep wc
grep ×1
wc ×1