Accessing MacOS X clipboard from CLI

pbcopy – copies data into clipboard
pbpaste – retrieves data from clipboard

echo "Test" | pbcopy
pbpaste