A multi-functional triboelectric nanogenerator (TENG) is developed, which enables to sense mechanical/magnetic stimuli in the self-powered manner, and presents favorable magneto-driven and target recognization performance for spilled oil treatment.