Use wget(1) To Expand Shortened URLs Leave a reply $ expandurl() { wget -S $1 2>&1 | grep ^Location; } via pthree.org