Extract all urls from the last firefox sessionstore.js file used.
2010-03-29
0 words
0 mins read
Some taken from commandlinefu. What all the below commands are doing is basically that the url: is captured from the sessionstore.js file and then just extract the URL from the line. These are done in various ways using perl, <a class="zem_slink freebase/en/sed" title="Sed" rel="wikipedia" href="http://en.wikipedia.org/wiki/Sed">sed and <a class="zem_slink freebase/en/awk" title="AWK" rel="homepage" href="http://cm.bell-labs.com/cm/cs/awkbook/index.html">awk:
List last opened tabs in firefox browser
F=”$HOME/.moz*/fire*/*/session*.js” ; <a class="zem_slink freebase/en/grep" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep -Go ’entries:[[^]]*’ $F | cut -d[ -f2 | while read A ; do echo $A | sed s/url:/n/g | tail -1 | cut -d” -f2; done
extract all urls from firefox sessionstore
sed -e ”s/[{/n/g” -e ”s/}, {/n/g” sessionstore.js | grep url | awk -F”,” '{ print $1 }’| sed -e ”s/url:”([^”]*)”/1/g” -e ”/^about:blank/d”
Extract all urls from the last firefox sessionstore.js file used.
grep -oP ’”url”:”K[^”]+’ $(ls -t ~/.mozilla/firefox/*/sessionstore.js | sed q)
Extract all urls from last firefox sessionstore used in a portable way.
perl -lne ’print for /url”:”K[^”]+/g’ $(ls -t ~/.mozilla/firefox/*/sessionstore.js | sed q)
Extract all urls from the last firefox sessionstore.js file used.
sed -e ’s/{”url”:/n&/g’ ~/.mozilla/firefox/*/sessionstore.js | cut -d” -f4
<a href="http://feedads.g.doubleclick.net/~a/XACknx22B-yalEyu1-bsKYqdn3g/1/da"><img src="http://blog.amit-agarwal.com/wp-content/uploads/img.zemanta.com/~a/XACknx22B-yalEyu1-bsKYqdn3g/1/di" alt="" align="bottom" /><h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://hacks.mozilla.org/2009/12/file-drag-and-drop-in-firefox-3-6/">file drag and drop in Firefox 3.6 (hacks.mozilla.org) <li class="zemanta-article-ul-li"><a href="http://www.techcrunch.com/2009/12/13/google-phone-game/">Google Phone Get Its Own Holiday Game. Nexus One Users Only. (techcrunch.com) <li class="zemanta-article-ul-li"><a href="http://lifehacker.com/5427366/remains-of-the-day-dont-expect-great-iphone-service-friday-edition">Remains of the Day: Don’t Expect Great iPhone Service Friday Edition [For What It’s Worth] (lifehacker.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/562c14c1-f6a8-4ab0-bc11-7edc99e79773/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b32.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">
Related Articles:
- 2009/12/19 check out http://browsershots.org/
- 2010/03/28 Break Free and let firefox remember all the passwords even the ones that are not saved by default
- 2010/03/28 Search & replace with find & ed
- 2010/03/25 vim search multiple files
- 2010/03/24 Recursive Regular Expressions