# AG\_DIRCLEAN > [HTML Version](ag_dirclean.htm) _Reviewed and revised December 2023_ **tab(-10, AG\_DIRCLEAN); dirspec, \{,wildspec, flags, timelimit, bytes\}; chr(127);** [Tab(-10,x) Syntax Notes](ag_xxx_syntax-notes.htm.md) AG\_DIRCLEAN (114) scans a specified directory, counting and/or deleting files based on various filter attributes. See [MX\_DIRCLEAN](mx_dirclean.htm.md)[xs](keyword-types.htm.md) for specifications on parameters. This function has both a [subroutine and a print tab implementation](subroutine-print-pairs.htm.md). **Response** _status, bytes_ CR _status_ indicates the number of files matched or deleted; negative values are errors _bytes_ returns the number of bytes in matched or deleted files **See Also** • [MX\_DIRCLEAN](mx_dirclean.htm.md)[xs](keyword-types.htm.md) **History** 2023 August, A-Shell 6.5.1740: Function added to A-Shell.