I want to find the number of 8 letter words that do not contain the letter “e” in a number of text files (*.txt). In the process I ran into two issues: my lack of understanding in quantifiers and how to exclude characters. I’m quite new to the Unix terminal, but this is what I have tried: I …
Tag: wc
Count the number of characters, words and lines in PowerShell
In Linux we have the “wc” command which allows us to count the number of characters, words and lines in a file. But do we have a similar cmdlet in PowerShell. The Measure-Object cmdlet I tried could only count the number of lines but not the characters and words. Answer It counts the number of cha…
How do I find the number of all .txt files in a directory and all sub directories using specifically the find command and the wc command?
So far I have this: I’m not quite sure how to use wc to find out the exact number of files. When using the command above, all the .txt files show up, but I need the exact number of files with the .txt extension. Please don’t suggest using other commands as I’d like to specifically use find a…
How to get lines of a file with exactly 3 characters in Linux
I need a command to find the lines of a file that have 3 characters. I do the command wc -w field.txt to list how many lines, but now I need to know the lines with 3 characters, exactly. Answer This will count (-c) the number of lines which match the regex (-E) “^.{3}$”, which is “start of l…