1

Tip #668   Split a long URL

Ever wanted to look at a long HTML URL more easily, say to investigate a parameter. Here is a search from MapQuest.

http://www.mapquest.com/maps/map.adp?formtype=address&addtohistory=&address=10%20Market%20St&city=San%20Francisco&state=CA&zipcode=94111

We can split this using:

$ echo "[insert url here]" | tr "&?" "\n"

This produced for the above URL the following output.

http://www.mapquest.com/maps/map.adp
formtype=address
addtohistory=
address=10%20Market%20St
city=San%20Francisco
state=CA
zipcode=94111
 
  • TAGS:
  • tr