Grep command and tags generation