Bash: mv (move) all files containing a string to a directory

mv `grep yourstring -l -- *` yourdirectory

The long horizontal line before the asterisk (*) is a double-dash, erroneously converted into an mdash by WordPress.