Run wc and display only the word count
By default, wc
print result along with filenames. If you want only the result, you must make wc
read input from stdin:
</usr/share/dict/words wc -w > ~/dicwords.txt
With your current solution, you can use some other tools to get only the result from wc
, like cut
, awk
, grep
...
wc -c /usr/share/dict/words | cut -d' ' -f1 > ~/dicwords.txt