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
More Related Contents:
- In the shell, what does ” 2>&1 ” mean?
- Difference between single and double quotes in Bash
- Command not found error in Bash variable assignment
- What is the difference between $(command) and `command` in shell programming?
- Can I export a variable to the environment from a Bash script without sourcing it?
- How to urlencode data for curl command?
- Shell equality operators (=, ==, -eq)
- Assigning default values to shell variables with a single command in bash
- I just assigned a variable, but echo $variable shows something else
- Shell script to delete directories older than n days
- Count occurrences of a char in a string using Bash
- How to redirect output of an entire shell script within the script itself?
- Quick-and-dirty way to ensure only one instance of a shell script is running at a time
- Should aliases go in .bashrc or .bash_profile? [duplicate]
- How to read user input into a variable in Bash?
- What is the difference between ${var}, “$var”, and “${var}” in the Bash shell?
- What does the Bash operator
- What is the exact meaning of IFS=$’\n’?
- Remove duplicate entries in a Bash script [duplicate]
- source command not found in sh shell
- How to parse a CSV in a Bash script?
- How to check if a file contains a specific string using Bash
- How to check if running in Cygwin, Mac or Linux?
- What’s a concise way to check that environment variables are set in a Unix shell script?
- Escaping forward slashes in sed command [duplicate]
- How to wait for an open port with netcat?
- run bash command in new shell and stay in new shell after this command executes
- How to update one file in a zip archive
- Why doesn’t my terminal output unicode characters properly?
- How to read variables from file, with multiple variables per line?