Let's say I'd like to know how many .png images I have in a folder. In shell I'd run:
ls -1 | grep .png | wc -l
Is there a way to achieve this in emacs (preferably not just reading in from a shell output)?
(length (directory-files "~/Pictures" nil "\\.png\\'"))
In dired (in directory in which you want to count .png files)
(length (directory-files "" nil "\\.png\\'"))