urlencode
urlencode OPTIONS [STRING]
urlencode is a simple command line utility to URL encode content. By default it reads from standard input and writes to standard out. You can also specifty the string to encode as a command line parameter.
You can provide the string to encode as a command line parameter otherwise it will be read from standard input.
echo “This is the string to encode & nothing else!” | urlencode
would yield
This%20is%20the%20string%20to%20encode%20&%20nothing%20else%0A