"dirty," by 1845, from grub (n.) in a sense of "dirty child" (who presumably got that way from digging in earth) + -y (2). Earlier it was used in a sense of "stunted, dwarfish" (1610s) and "infested with grubs" (1725). Related: Grubbily; grubbiness.
1736, in Kentish dialect, "dirty, foul," a word of uncertain origin, but perhaps related to dung. Meaning "soiled, tarnished, having a dull, brownish color" (from grime or weathering) is by 1751; hence "shabby, shady, drab" (by 1855). The noun dinge "dinginess" (1816) is a back-formation; as a derogatory word for "black person, Negro," by 1848. Related: Dingily; dinginess.
"sloppiness, dirtiness," also "untidy person," 1965, American English teen slang, probably a back-formation from grungy. In reference to the music and fashion style that originated in Seattle is attested from 1989.
<a href="https://www.etymonline.com/word/grungy">Etymology of grungy by etymonline</a>
Harper, D. (n.d.). Etymology of grungy. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/grungy