sound output raspberry pi

Shell
# You can juste type the command bellow on the terminal
amixer cset numid=3 0
#the last figure acn be: 0 for auto, 1 for 3.5mm Jack or 2 for HDMI
Source

Also in Shell: