Linux count the number of the files in that directory and its subdirectories

count  the number of the files in that directory and its sub directories is:

ls -laR | grep -v ^[.dlt] | grep -v ^$ | wc -l

OR run either of  the below codes  :-

for t in files links directories; do echo `find . -maxdepth 1 -type ${t:0:1} | wc -l` $t; done 2> /dev/null


50 files
0 links
74 directories


for t in files links directories; do echo `find . -type ${t:0:1} | wc -l` $t; done 2>/dev/null

6781 files
0 links
814 directories


Comments

Popular posts from this blog

Installing DBMS_JAVA package in Oracle and calling UTL_DBWS web services through Oracle database

stick the job to the specific instance in Oracle RAC

finding fragmentation at table level and tablespace level in Oracle and steps to remove them