LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to find and count directory and files found by use of find (https://www.linuxquestions.org/questions/programming-9/how-to-find-and-count-directory-and-files-found-by-use-of-find-4175687851/)

BudiKusasi 01-01-2021 07:37 PM

How to find and count directory and files found by use of find
 
How to find and count directory and files found in find util in Bash Linux, and put in env. variable, or print out, or both, each e.g
Code:

NUM_FILE=
NUM_DIR=

of : (just illustration)
Code:


find . -type d ...... -o type f .......... -print..... # ???


Keith Hedger 01-02-2021 05:52 AM

Use find with the -type flag and pipe to wc or use the -exec option, see the man page for wc and find


All times are GMT -5. The time now is 10:19 AM.