1

All the methods I found on the Internet involved using a .jsp page and a web browser. I have Linux servers with no GUI desktops.

I do not want to use the web browser on a desktop to view a .jsp file on every web browser. I want to find out from the backend. This way I can use a script to find out on every server.

How do I find the version of JQuery that is installed on a Linux web server?

  • what relation JQuery has to Java Server Pages? – Serge Jun 8 '16 at 0:54
  • 1
    Most linux web servers do not host a jQuery. Most websites use a CDN to host their jquery since it means a faster delivery (browsers limit the number of simultaneous connections to a single source) – grochmal Jun 8 '16 at 1:14
  • @Serge: there is no relationship. I am new at this. But I did do investigation before asking. I tried the JavaScript code in .html files too. I guess I should not have used the .jsp extension. The .js extension was not working for my web pages. – Kiran Jun 8 '16 at 1:15
  • So you want an answer from after you've SSH'ed into the box, to see what version of jquery it is serving? – rogerdpack May 9 at 23:11
0

File test.sh

#!/bin/bash
out=$(wget -qO- $1 |
 grep -Eoi '<script [^>]+>' |  
 grep -Eo 'src="[^\"]+"' | 
 grep -Eo '["\047].*["\047]' | sed 's/\"//g')

echo -e $out | tr -s ' ' | tr ' ' '\n' | grep -i "jquery"

Save the above commands as a shell script file.

bash test.sh <site_url>

The output will be

/resources/js/vendor/jquery.js
/resources/js/vendor/jquery-ui.js
/resources/js/vendor/jquery.handsontable.full.js
/resources/js/vendor/jquery.bxslider.js

It will print only the jquery URLs inside the tag

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.