perl -pe 's/ /\n/g;' file1.txt > list1.txt tail +2 list1.txt > list2.txt tail +3 list1.txt > list3.txt tail +4 list1.txt > list4.txt paste list1.txt list2.txt list3.txt list4.txt > save1.txt tr A-Z a-z < save1.txt | perl -pe 's/[|.|.]//g;' > save2.txt sort save2.txt | uniq -c | sort -nr > save3.txt perl -ne 'while(<>){if(/ about the nature of\n/|/ as a result of\n/|/ as a function of\n/|/ as part of the\n/...){print; }}' 4gram.txt perl -ne 'while(<>){next if(/ about the nature of\n/|/ as a result of\n/|/ as a function of\n/|/ as part of the\n/...){print; }}' 4gram.txt > •Û‘¶‚P.txt perl -ne 'while(<>){if(/ and a \w+ of\n/|/ and the \w+ of\n/|/ as a \w+ of\n/|/ at the \w+ of\n/|/ by the \w+ of\n/...){print; }}' •Û‘¶1.txt