wget -qO - https://raw.githubusercontent.com/torvalds/linux/master/Makefile | head -n5 | grep -E '\ \=\ [0-9]{1,}' | cut -d' ' -f3 | tr '\n' '.' 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' '.'

Share Your CommandsGet current stable kernel version string from kernel.orgeasiest way to get kernel version without unameGet current stable kernel version string from kernel.orgGet current stable kernel version string from kernel.org

There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,… Subscribe to the feed for: commandlinefu.com © 2018 Dan's Tools | FAQs | API | Widget | Privacy

Related Articles