The flux pumps can realize non-contact excitation of high-temperature superconducting (HTS) magnet and eliminate heat leakage caused by current leads. However, earlier proposed flux pump needs to be installed inside the cryostat, which leads to additional heat load to the cryogenic system. Here, we report the successful demonstration of a through-wall linear-motor type flux pump, with its heating parts such as the copper windings completely outside the cryostat, while its generated heat is dissipated in the air and insulated from the cryostat. With an insulation HTS double pancake coil installed in the cryostat and cooled by a G-M cryogenic cooler at 32.6 K, we have demonstrated the injection of direct currents of 42 A into the closed-loop, without the current leads. Thus, the feasibility and reliability of using the linear-motor type flux pump as the power source to excite the HTS through the cryostat is verified, making it possible for future applications such as in MRI and superconducting motors, etc.