Today I needed to use a tool to look up information about 30 or so blogs at work. The tool is a web-based internal tool, which accepts a blog_id as a parameter in the url. I used some UNIX magic to extract these from some other information, so that I had a simple list in my terminal. Instead of clicking on each one, I decided to try to find an easier route, and indeed, I found one right away. I have my iTerm2 terminal configured to copy on highlight, which means I simply highlighted the urls in the terminal. Then I used the handy pbpaste
command on MacOS (other OSes have something similar, I believe Cygwin is getclip
, on Linux you can use xclip
and xsel
). MacOS also has a handy command called open
, which automatically decides which application to use depending on the type of argument. If you give it a url, it will open with your default browser (which for me is Firefox). In order to do this for all the urls in one fell swoop, I used the xargs
command, which passes all the arguments to one command. Thus my command looked like
pbpaste | xargs open
All of the urls started opening in parallel in separate tabs, and then I was able to quickly go through each one and get the information I needed.