The moving device 10 in pipe lines comprises a guide frame 11 in which a line of three or more coils 15, 16, 17 is interconnected flexibly in the direction of magnet flux, ring-shaped permanent magnets 19, 20, 21 provided around the periphery of the guide frame slidably in the direction of the shaft, and a control means such as computers etc. to control by a preset program selecting the direction