If this is the problem running in your head then the following one liner will be helpful to you.
$ echo "1234567890" | sed -e ':a' -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta'
1,234,567,890
$ echo "1234567890" | sed -e ':a' -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta'
1,234,567,890
cat filename | grep "phrase"cat filename | grep -v "phrase"cat filename | grep "phrase1\|phrase2"sed -i "s/phrase1/phrase2/g" ./filenamesed -i "s/[ ]*\(.*\)[ ]*/\1/g" ./filenameawk '{if($7=="2") $7="5"; print;}' fileuptime | awk 'BEGIN {FS=" "} { gsub(",",""); if (index($0,"day")) {gsub(":"," hours, ",$5);print $3" "$4", "$5" minutes"} else {gsub(":"," hours, ",$3); print $3" minutes"}}'ls | grep -v 'file or folder or regex' | xargs -I{} mv {} /target/folder/