Top "Wc" questions

`wc` is a standard POSIX command that counts words, lines, and characters.

bash echo number of lines of file given in a bash variable without the file name

I have the following three constructs in a bash script: NUMOFLINES=$(wc -l $JAVA_TAGS_FILE) echo $NUMOFLINES" lines" echo $(…

bash wc
How to get "wc -l" to print just the number of lines without file name?

wc -l file.txt outputs number of lines and file name. I need just the number itself (not the file …

shell wc
get just the integer from wc in bash

Is there a way to get the integer that wc returns in bash? Basically I want to write the line …

bash wc
Counting characters, words, length of the words and total length in a sentence

I have to write a script that takes a sentence and prints the word count, character count (excluding the spaces), …

shell wc
Unix Command to get the count of lines in a csv file

Hi I am new to UNIX and I have to get the count of lines from incoming csv files. I …

unix count newline line-numbers wc
How to count lines of code including sub-directories

Suppose I want to count the lines of code in a project. If all of the files are in the …

linux bash unix wc
results of wc as variables

I would like to use the lines coming from 'wc' as variables. For example: echo 'foo bar' > file.txt …

bash shell wc
Use find, wc, and sed to count lines

I was trying to use sed to count all the lines based on a particular extension. find -name '*.m' …

bash sed find wc
How to count lines fast?

I tried unxutils' wc -l but it crashed for 1GB files. I tried this C# code long count = 0; using (StreamReader …

c# streamreader wc
How to count number of bytes in a file using C?

How to count the number of bytes for a file using C? Suppose the file below contains some code (data) …

c algorithm wc