First of all, this is all one command in one single line. Not two commands. No let's dissect this command into its parts.
tmsh list ltm virtual one-line | grep "profiles.*\ http\ "
The above will list ALL virtuals that have the default http profile called http, one line per VS. That's what grep does.
tmsh list ltm virtual one-line | grep "profiles.*\ http\ " | awk '{ print $3 }'
This will do the same, but it will print only the third ($3) field from output of the previous command - which is the VS name. That's what awk does.
tmsh list ltm virtual one-line | grep "profiles.*\ http\ " | awk '{ print $3 }' | xargs -I vs_name tmsh mod ltm virtual vs_name profiles add { pr_http } profiles delete { http http }
Now this will take the output from awk, the virtual server name, and use them as argument for the tmsh modify. That's what xargs -I vs_name does. It puts the virtual server name into the variable vs_name which I later use in tmsh modify.
And with tmsh modify I add the new http profile and delete the old one.
This last and very long command will not show any output at the end, it will run with no message like "Success" or "Completed".