Hi,
uname prints the system information, -r prints the kernel version. The sed operation above used in pipeline is replacing whatever is present after first 3 digits like 1.2.3.4.5 --> 1.2.3
so uname -r | sed 's/\([0-9]*\. [0-9]*\. [0-9]*\).*/\1/' is same as uname -r.
sed 's /\([0-9]*\. [0-9]*\. [0-9]*\).*/\1/'
| | | | |
| | Start of Search Pattern | end of replacement pattern
| | |end of search pattern and begin pattern to be replaced if search pattern is found
| Substitution
|
sed command
\([PATTERN]\) store the pattern in \1 variable.
\. escaping '.' character.
[0-9] --character set 0 to 9
[Pattern]* -- 0 or more occurrence of Pattern
.* -- 0 or more occurrence of any character.
Hope this helps!