linux - How to check latest kernel version by bash -


How can I check the latest kernel version by bash? Is there a command to check the latest kernel?

If you are looking for the latest kernel version of the website and not one on your system, You can use. This will work fine unless they change their page layout later. If they do, in that case, you have to zoom your order:

  [root @ slave2 gc] # curl -s https://www.kernel.org / | Grep-A1 'Mainline:' | Grep -oP '(? & Lt; = strong & gt;). * (? = & Lt; /strong.*) '3.16-rc7  

This will return the' Main Line 'release to you. You can search for 'stable' release using the same logic.

Explanation:

-o The only option for printing patterns.

-P Explain the pattern as a Pearl regular expression.

(? = Pattern) Positive looking positivity of a zero-width. To put it in simple words using an example, q (? = U) matches AX which is followed by U.

(? & Lt; = pattern) A zero-width positive-back-to-back argument to put it in simple words using an example, matches (? & Lt; = a) b (and only b) in the taxi but the loan does not match the loan

Whatever pattern matches, actually is removed from the output and so on we get results. :)

You can see these links for more detail:


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -