I’m looking for a specific directory file count that returns a number. I would type it into the terminal and it can give me the specified directory’s file count.
I’ve already tried echo
find "'directory' | wc -l" but that didn’t work, any ideas?
You seem to have the right idea. I’d use
-type f to find only files:
$ find some_directory -type f | wc -l
If you only want files directly under this directory and not to search recursively through subdirectories, you could add the
$ find some_directory -maxdepth 1 -type f | wc -l
Answered By – Mureinik