"to move about restlessly," mid-15c., perhaps a variant of frisk (q.v.). As a euphemism for "to fuck" it dates from 1680s, earlier as "to masturbate" (1670s). Related: Frigged; frigging.
take a flying fuck
[ultimately fr Latin fricare, ''rub'']