`wc` utility counts newline, word, and byte for file(s) or standard input.

learn more… | top users | synonyms

4
votes
2answers
811 views

Number of lines outputted by ls

When ls is called, it outputs all the files/directories in the current directory, attempting to fit as many as possible on each line. Why is it that when passed to wc -l, it outputs the number of ...
3
votes
1answer
149 views

Run wc and display only the word count

I have been trying to create a file called ~/dictwords.txt, which contains the number of words found in the file /usr/share/dict/words. I already created the file then I removed it because I did it ...
4
votes
3answers
1k views

How does word count work for newline (-l)? Number of newlines or lines

I wonder how does wc work? Most times it seems to return the number of lines, but sometimes it seems to be newlines? In the man page its newlines. But: [jiewmeng@JM textFiles]$ echo -e "\n\n" | wc - ...
4
votes
2answers
766 views

How to count the number of lines in a UTF-16LE/CR-LF/BOM file?

The immediate thought is wc, but then the next not-so-immediate thought is... Is *nix's wc purely for *nix line endings \x0a?... It seems so. I've semi-wangled my way around it, but I feel there ...
1
vote
1answer
426 views

Speeding a find rm command with test through parallelization

I want to recursively delete all files in directories and subdirectories with number of lines less than 10, and am currently using the following command find . -type f -name "*.txt" | while read; do ...