Compute newest kernel version from Makefile on Torvalds' git repository

wget -qO - https://raw.githubusercontent.com/torvalds/linux/master/Makefile | head -n5 | grep -E '\ \=\ [0-9]{1,}' | cut -d' ' -f3 | tr '\n' '.' | sed -e "s/\.$//"
Get newest kernel version by parsing the most bleeding-edge Makefile possible. Useful for doing things like writing live ebuilds and/or self-updating PKGBUILDs for testing purposes. Breakdown: * wget -qO - https://raw.githubusercontent.com/torvalds/linux/master/Makefile — retrieve Makefile and pipe to stdout * head -n5 — only the first 5 lines are relevant, that's where all the version variables are grep -E '\ \=\ [0-9]{1,}' — version variables always have an equals sign followed by a number * cut -d' ' -f3 — extract the individual numbers from the version variables * tr '\n' '.' — replace newlines with periods * sed -e "s/\.$// — remove trailing period
Sample Output
5.12.0

What Others Think

I am Tech blogger. I have 7 years of experience as SEO specialist. I have been accepting paid guest posts in my technology blog Web Tech Mantra. If anyone interested contact with me. We are accepting unique articles only. Our niches technology, mobiles, software, trends, security, computers, android, iOS, digital marketing, SEO, Business, etc. 13377x proxy
vyshu · 1 week and 3 days ago
It is very interesting for me to know about new things and information programming languages from here. I thought it will be a new things for you to get these type of post from here. Get to know about it. gia diamond verification
zaiyamariya · 1 week and 3 days ago
Great post! I didn’t knowral of these resources and I’m going to go check them out now! subway surfers
jonesrebecca · 1 week and 3 days ago
Need academic help? I like the writing service at Writepaperforme, there are good prices and paper quality. Check also Writepaperforme reviews to get more facts about them.
LizaFlores · 1 week and 2 days ago
This is so far the best command in few days and also on your site as ping always being too distracting for everyone. http://wativ.com/promo-codes/omio.com/">omio coupon code will keep this ping in its another online booking & surely use this command.
wativ · 1 week and 2 days ago
omio
wativ · 1 week and 2 days ago
You made some clear commands there. I did a search on the commands and found most people will go along with with your blog... Boat Coloring Pages
muneerahmed · 1 week and 1 day ago
It has a Latin American fiesta theme with symbols including a bull piñata, a donkey piñata, a dog piñata, a rose, a sombrero and more. The slots game features wild symbols, scatters, a bonus round and free spins. ? ??????
dtaqpl7045 · 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: