To count total files in directory

 

Explanation:
find : find is a command for recursively filtering objects in the file system.
DIR_NAME : Directory name in which you have to calculate files.
* Replace DIR_NAME with . (dot) to find in the current directory.
-type f : Only find the files.
| : Piping the output of find command to the input of wc command.
wc : Command to count word.
-l : To count total number of lines.

Leave a Reply

Your email address will not be published. Required fields are marked *