Count all files in a directory and subdirectories (linux)
July 31, 2020 ≈ 21 seconds
First, we need to find needed files, using the 'find' command. The find utility recursively descends the directory tree for each path listed, evaluating an expression in terms of each file in the tree. Next, we need to count lines, using wc (word, line, character, and byte count) command with -l (lines) parameter.
Let's count all *.conf files in directory and all subdirectories:
find . -name '*.conf' -type f | wc -l
You didn't provide any data, entered invalid email or already subscribed.
Try again. And if you still can't subscribe—write us.
Address successfully subscribed!