I'm looking for a command that lists me the latest kernel installed on a (Debian) system. For example grub-mkconfig
"somehow" knows what the latest kernel version is. How does it achieve that? I know I can see it by looking but is there a command that can interpret the versions correctly?
- 积分
0 - 话题
0 - 评论
3177 - 注册排名
2651
You can use
sort -V
which is commonly available on Linux systems; it sorts version numbers:甚至
if your
ls
supports that.要仅查看最新消息,请仅保留最后一行:
That’s pretty much how
grub-mkconfig
goes about it; see/usr/lib/grub/grub-mkconfig_lib
for the details.