xargs
will let you cat
all the files together before passing them to wc
, like you asked:
git ls-files | xargs cat | wc -l
But skipping the intermediate cat
gives you more information and is probably better:
git ls-files | xargs wc -l
Related Contents:
- Difference between sh and Bash
- How can I declare and use Boolean variables in a shell script?
- Replace one substring for another string in shell script
- Assigning default values to shell variables with a single command in bash
- When do we need curly braces around shell variables?
- Colorized grep — viewing the entire file with highlighted matches
- Process all arguments except the first one (in a bash script)
- How to create a cron job using Bash automatically without the interactive editor?
- How to generate random number in Bash?
- How to check if an environment variable exists and get its value? [duplicate]
- Bash conditionals: how to “and” expressions? (if [ ! -z $VAR && -e $VAR ])
- Save file to specific folder with curl command
- How do you echo a 4-digit Unicode character in Bash?
- How to redirect output of an entire shell script within the script itself?
- Correct Bash and shell script variable capitalization
- source command not found in sh shell
- String comparison in bash. [[: not found
- How to grep for case insensitive string in a file?
- How to go to each directory and execute a command?
- Shell script to delete directories older than n days
- Checking if output of a command contains a certain string in a shell script
- How do I escape the wildcard/asterisk character in bash?
- What does `kill -0 $pid` in a shell script do?
- How can I extract the first two characters of a string in shell scripting?
- How does bash tab completion work?
- Clean way to launch the web browser from shell script?
- Making ZSH default Shell in MacOSX [closed]
- How to update one file in a zip archive
- Using sed to mass rename files
- What’s the meaning of the parameter -e for bash shell command line?
- How to embed bash script directly inside a git alias
- How do I add a line break for read command?
- Shell Script: How to write a string to file and to stdout on console?
- How do you call a function defined in .bashrc from the shell? [duplicate]
- Is bash a programming language?
- Convert seconds to hours, minutes, seconds
- Delete all broken symbolic links with a line?
- What does the colon dash “:-” mean in bash [duplicate]
- Bash scripting, multiple conditions in while loop
- Quick-and-dirty way to ensure only one instance of a shell script is running at a time
- Rename multiple files in shell [duplicate]
- Shell script common template
- read stdin in function in bash script
- How do I get just real time value from ‘time’ command?
- Rename Directory Name Before tar Happens
- Use bash to find first folder name that contains a string
- sh command: exec 2>&1
- Should I use quotes in environment path names?
- Here document as an argument to bash function
- Invoke function whose name is stored in a variable in bash