« first day (4138 days earlier)      last day (811 days later) » 

1:50 PM
@terdon what make this '{print $NF}' part?
 
2:06 PM
@nobody context?
That looks like an awk script that will print the last space-separated field of every line in its input.
 
your command for available linux-images wget -O - packages.ubuntu.com/focal/kernel 2>/dev/null | grep -oP 'Linux kernel image for version \S+' | awk '{print $NF}' | sort | uniq | sort -Vr
 
Ah, right. Yes, that just print the last field, in this case, the version of the package:
terdon@tpad ~ $ wget -O - packages.ubuntu.com/focal/kernel 2>/dev/null | grep -oP 'Linux kernel image for version \S+'  | head -n1
Linux kernel image for version 5.11.0
terdon@tpad ~ $ wget -O - packages.ubuntu.com/focal/kernel 2>/dev/null | grep -oP 'Linux kernel image for version \S+'  | head -n1 | awk '{print $NF}'
5.11.0
 
Oh thanks.
 
you're welcome
This is a special awk variable which holds the number of fields in each line (NF=="number of fields") and is automatically updated for each inputline. So since in awk fields are numbered with the 1st field being $1, the second $2 etc, because NF is the number of fields, it will be 3 if there are three fields. Therefore, {print $NF} prints the last field.
 
this script things are not mine.
 
2:30 PM
Those are the greatest power of the *nix command line: the ability to chain multiple utilities together to run complex commands.
It does take a little (OK, maybe a lot) of time to learn, but once you've learned them and gotten used to them, it really frees your hands!
I never use a file manager for example. It is always easier for me to do all file operations (copy, rename, move, whatever) from the command line.
 
but after 3 chained commands my head becomes empty. :D
 
Yeah, I can understand that. It really gets easier with practice though!
 
On my debian there is a folder with the for me importance commands. your one is also end up there too
 
 
1 hour later…
3:48 PM
0
Q: End of Life Notice: Ubuntu 21.04 (Hirsute Hippo) reached End of Life on January 20, 2022

Thomas Ward This will be enforced starting from January 20, 2022 and onwards. This is a notice regarding releases of Ubuntu that will be reaching, or have reached, the end of their standard support period. These releases are no longer on topic effective the above enforcement date. The following version of...

 

« first day (4138 days earlier)      last day (811 days later) »