Tuesday 18 February 2014

Shell Script To Count Number Of Files In A Directory & Subdirectories

Execute the below script to find number of xml files are there within a directory and sub directory.

  • find . -type f -name "*.xml" | wc -l
To Count Number of files which are not xml files execute the following command : 
  • find . -type f  ! -name "*PG.xml" | wc -l 
To Count number of total files in a directory and sub directories execute the following command: 
  • find ./ -type f | wc -l

No comments:

Post a Comment