wc

How do you use cat recursively?

Suppose I want to count the lines of code in a project. If all of the files are in the same directory I can execute: cat * | wc -l However, if there are sub-directories, this doesn't work. For this to work cat would have to have a recursive mode. I suspect this might be a job for xargs, but I wonder if there is a more elegant solution...

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' -exec wc -l {} \; | sed ... I was trying to do the following, how would I include sed in this particular line to get the totals. ...

Calling linux utilities with options from within a Bash script.

This is my first Bash script so forgive me if this question is trivial. I need to count the number of files within a specified directory $HOME/.junk. I thought this would be simple and assumed the following would work: numfiles= find $HOME/.junk -type f | wc -l echo "There are $numfiles files in the .junk directory." Typing find $HOME...

new svn server, same ip

Hello, Here is my problem: My server crashed last night! So i had to go out and buy some new stuff and i now have a new server. I have everything set back up and i am trying to set my svn server back up. I have it set back up. I have my files on another pc that i want to commit to the svn server to start my repository back up. How do i...

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 numbers and word counts to the screen after the file name. output: filename linecount wordcount Here is what I have so far: files=`ls` for f in $files; do if [ ! -d $f ] #only print out information about files !directories then...

How can I count all of the lines in all of the files in the current directory and child directories?

I'm trying to figure out how many lines of code have been written for an app. Code is in the current directory and child directories. I'm using ubuntu. ...

UNIX: Physical Location of "wc" command. It ain't "/bin"

This has be stump. I wrote a shell program in C that allows the user to execute several commands. Based on my research so far, all the commands such as "ls" and "cat" are located in "/bin/". The "wc" is not listed in this directory - "/bin". If I fire up a terminal, I can type "wc fileName" and it works. I ran "find . wc" from the...