Trying to install CocoaPods using terminal getting command not found
the $ in the lines shown is meant to represent the command prompt of the terminal.

enter the commands without the $ preceding..also the [sudo] part represents the requirement to use sudo or not (you will probably need to) so this comes down to entering

sudo gem install cocoapods
pod setup


before embarking further on your exploration of the command prompt you might find it helpful to have a look through some of the resources on this superuser question