grep takes a file directly, so this could simply be: time grep tt9184994 title_complete_json.txt >> result
grep takes a file directly, so this could simply be: time grep tt9184994 title_complete_json.txt >> result