Move all files containing the text "status: draft" to another folder. for i in `grep -l "status: draft" *`; do mv $i ~/Documents/jekyllDrafts/; done;