---
title: "How to monitor number of files in a folder?"
description: "Monitoring the number of files in a folder can be done using the FKM or Toolkit plugin. Enabling wildcardMonitorAllMatches in FKM includes all files and directories on the specified path."
url: "https://docs.itrsgroup.com/docs/faq/geneos/115004030589-geneos-how-to-monitor-number-of-files-in-a-folder/index.html"
---
You can achieve this using the FKM plugin or the Toolkit plugin. The script is not supported by ITRS and user is responsible on writing their own script. The following is some examples that you can use.

For Linux:

```
#!/bin/bash
 echo "name, value"
 echo "count,"`echo $(($(ls -l | grep -v ^d | wc -l)-1))`
```

For Windows (for drive other that C: ):

```
@echo off
 CD /D D:\your_folder
 setlocal enableextensions
 set count=0
 for %%x in (*) do set /a count+=1
 echo name,value
 echo fileCount,%count%

 endlocal
```

By using FKM plugin, enable the wildcardMonitorAllMatches setting on the FKM's advanced tab.


**Note**



This will also include the directories on the specified path.




![Sample FKM plugin](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-sample-plugin.png)

![Enabled wildcard monitor all matches setting](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-enable-wildcard-monitor-all-matches.png)

![FKM plugin metrics](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-fkm-metrics.png)


