Open Windows internet shortcut (*.url) files in firefox

grep -i url='*' file.url | cut -b 5- | xargs firefox

September 12, 2014tsjswimmer

Explanation

Extract urls from a *.url file and open in Firefox. (Note that *.url files in Windows are basically just text files, so they can be parsed with a few commands.)

  • grep extracts lines starting with url=
  • The -i flag is to ignore case
  • cut extracts the range of characters from the 5th until the end of lines
  • xargs calls Firefox with arguments taken from the output of the pipeline

Related one-liners

Open Windows internet shortcut (*.url) files in firefox

firefox $(grep -i ^url='*' file.url | cut -b 5-)

September 11, 2014tsjswimmer