Sheeshy Sipgrark
New member
How do I count the number of lines in a directory in Linux?
Answer
2 Answers
Answer
2 Answers
- make a list of all files under current directory with find . – type f.
- filter out files from “exclude” dirs with grep -v.
- xargs will read list of files from stdin and pass all files as options to cat .
- cat will print all files to stdout.
- wc will count lines.