Sometimes called a solenoid by industry, what you are looking for is an actuator.
You'll need a motor driver for it, but if you head to your local Wally World or Princesses Auto, you can usually find a "Door Lock Actuator" kit that will include a keychain FOB, receiver and 4 12V actuators. Pulse the 2 wires one way, actuators push outwards. Reverse polarity and they pull inwards.
That will give you a few inches worth.
If you need extreme linear movement, usually hobbyist level pneumatics are the key. I've seen a few props powered this way. Air is released into one tube that slides over another. Most roaming carny "funhouses" use this technique, hence that unique sound common to all of them.