When you say #18 you perhaps are not being clear which pin you mean, for the later RPis with a 40 Pin GPIO header pin 18 of 40 is a GPIO pin (possibly 5) that is directly connected to the Broadcomm IC at the heart of the RP. DO NOT CONNECT A MOTOR DIRECTLY TO AN RPI GPIO PIN. Alternatively you could mean that you connected the motor to the Broadcomm numbering GPIO 18 which is PWM0 and is pin 12 on the 40 pin header - again though DO NOT CONNECT A MOTOR DIRECTLY TO AN RPI GPIO PIN. You could possibly connect a 5V dc fan to pins 6 (-ve) and 2 (+ve) but that means the fan would be powered and running all the time the RPi is powered up - what you want at the barest minimum/simplest system is an NPN bipolar transistor (or darlington pair) with the collector connected to the negative lead on the fan and the emitter connected to the ground (pin 6 on the GPIO header) and the base connected through a resistor (say 10 to 22 KOhms) to a GPIO pin that is set to have the pull-up turned on. The positive wire of the fan should be connected to a suitable DC power supply with the ground wire also connected to the RPi ground.
With the above configuration you should be able to configure the relevant GPIO as an output - when it is taken to a high logic level (which it may do anyway before it is configured as an output) the current that flows out through the pin into the base of the transistor will be amplified by the gain current gain of the transistor/Darlington pair (which can be in range 20-800 depending on the particular transistor device chosen and the square of those values for a Darlington pair) and allowed to through the collect-emitter circuit and thus the fan which should then spin up to it's full speed provided its current requirement is less than that maximum possible figure and that the voltage drop across the transistor/Darlington (0.5V or so) collector-emitter junction when it is saturated (turned fully "on") does not drop the voltage too much to affect the fan (more significant if a 5V supply is used compared to 12V).
Driving the GPIO pin low will switch the transistor and thus the fan off.
Oh, and DO NOT CONNECT A MOTOR DIRECTLY TO AN RPI GPIO PIN! 8-)