My take on this.  The community cookbook is not always right.  We use them as a resource with the assumption that their stuff works.  When it comes to testing, we should use them as an example, not as a template.

To me, 'ls' is a directory listing tool.  'stat' is a file status tool.  I feel we should be using the correct tool.

Also, not sure where you got the information of 'dd' varying, but dd uses the args given to it.  You want a 1M file, it will do that.

So, let's make a compromise - let's get rid of the double grep and use ls with these flags:

`ls --size --block-size=M /mnt/ephemeral/swapfile | grep "^1024M"`

Thoughts?